Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 014ce9e

Browse files
more percy tests
1 parent 5eb7740 commit 014ce9e

File tree

1 file changed

+41
-10
lines changed

1 file changed

+41
-10
lines changed

test/percy/plotly-express.py

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -451,23 +451,15 @@
451451
],
452452
}
453453
fig = px.choropleth_mapbox(
454-
geojson=sample_geojson,
455-
locations=["the_polygon"],
456-
color=[10],
457-
mapbox_style="carto-positron",
458-
zoom=6,
454+
geojson=sample_geojson, locations=["the_polygon"], color=[10], zoom=6,
459455
)
460456
fig.write_html(os.path.join(dir_name, "choropleth_mapbox.html"), auto_play=False)
461457

462458
import plotly.express as px
463459

464460
carshare = px.data.carshare()
465461
fig = px.density_mapbox(
466-
carshare,
467-
lat="centroid_lat",
468-
lon="centroid_lon",
469-
z="peak_hour",
470-
mapbox_style="carto-positron",
462+
carshare, lat="centroid_lat", lon="centroid_lon", z="peak_hour",
471463
)
472464
fig.write_html(os.path.join(dir_name, "density_mapbox.html"), auto_play=False)
473465

@@ -509,3 +501,42 @@
509501
range_color=[20, 80],
510502
)
511503
fig.write_html(os.path.join(dir_name, "choropleth.html"), auto_play=False)
504+
505+
import plotly.express as px
506+
507+
tips = px.data.tips()
508+
fig = px.pie(tips, names="smoker", values="total_bill")
509+
fig.write_html(os.path.join(dir_name, "pie.html"), auto_play=False)
510+
511+
import plotly.express as px
512+
513+
tips = px.data.tips()
514+
fig = px.funnel_area(tips, names="smoker", values="total_bill")
515+
fig.write_html(os.path.join(dir_name, "funnel_area.html"), auto_play=False)
516+
517+
import plotly.express as px
518+
519+
fig = px.treemap(
520+
names=["Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"],
521+
parents=["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve"],
522+
values=[10, 14, 12, 10, 2, 6, 6, 4, 4],
523+
)
524+
fig.write_html(os.path.join(dir_name, "treemap.html"), auto_play=False)
525+
526+
527+
import plotly.express as px
528+
529+
fig = px.sunburst(
530+
names=["Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"],
531+
parents=["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve"],
532+
values=[10, 14, 12, 10, 2, 6, 6, 4, 4],
533+
)
534+
fig.write_html(os.path.join(dir_name, "sunburst.html"), auto_play=False)
535+
536+
537+
import plotly.express as px
538+
539+
fig = px.funnel(
540+
y=["first", "second", "first", "second"], x=[3,1,4,2], color=["A", "A", "B", "B"]
541+
)
542+
fig.write_html(os.path.join(dir_name, "funnel.html"), auto_play=False)

0 commit comments

Comments
 (0)