plotly.js 1.51.2 → 1.52.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (970) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/LICENSE +1 -1
  3. package/README.md +1 -1
  4. package/dist/README.md +25 -25
  5. package/dist/plot-schema.json +529 -77
  6. package/dist/plotly-basic.js +1560 -689
  7. package/dist/plotly-basic.min.js +3 -3
  8. package/dist/plotly-cartesian.js +2373 -1050
  9. package/dist/plotly-cartesian.min.js +3 -3
  10. package/dist/plotly-finance.js +1880 -900
  11. package/dist/plotly-finance.min.js +3 -3
  12. package/dist/plotly-geo-assets.js +4 -4
  13. package/dist/plotly-geo.js +4066 -1010
  14. package/dist/plotly-geo.min.js +3 -3
  15. package/dist/plotly-gl2d.js +1142 -556
  16. package/dist/plotly-gl2d.min.js +3 -3
  17. package/dist/plotly-gl3d.js +1773 -1022
  18. package/dist/plotly-gl3d.min.js +3 -3
  19. package/dist/plotly-locale-af.js +1 -1
  20. package/dist/plotly-locale-am.js +1 -1
  21. package/dist/plotly-locale-ar-dz.js +1 -1
  22. package/dist/plotly-locale-ar-eg.js +1 -1
  23. package/dist/plotly-locale-ar.js +1 -1
  24. package/dist/plotly-locale-az.js +1 -1
  25. package/dist/plotly-locale-bg.js +1 -1
  26. package/dist/plotly-locale-bs.js +1 -1
  27. package/dist/plotly-locale-ca.js +1 -1
  28. package/dist/plotly-locale-cs.js +1 -1
  29. package/dist/plotly-locale-cy.js +1 -1
  30. package/dist/plotly-locale-da.js +1 -1
  31. package/dist/plotly-locale-de-ch.js +1 -1
  32. package/dist/plotly-locale-de.js +1 -1
  33. package/dist/plotly-locale-el.js +1 -1
  34. package/dist/plotly-locale-eo.js +1 -1
  35. package/dist/plotly-locale-es-ar.js +1 -1
  36. package/dist/plotly-locale-es-pe.js +1 -1
  37. package/dist/plotly-locale-es.js +1 -1
  38. package/dist/plotly-locale-et.js +1 -1
  39. package/dist/plotly-locale-eu.js +1 -1
  40. package/dist/plotly-locale-fa.js +1 -1
  41. package/dist/plotly-locale-fi.js +1 -1
  42. package/dist/plotly-locale-fo.js +1 -1
  43. package/dist/plotly-locale-fr-ch.js +1 -1
  44. package/dist/plotly-locale-fr.js +1 -1
  45. package/dist/plotly-locale-gl.js +1 -1
  46. package/dist/plotly-locale-gu.js +1 -1
  47. package/dist/plotly-locale-he.js +1 -1
  48. package/dist/plotly-locale-hi-in.js +1 -1
  49. package/dist/plotly-locale-hr.js +1 -1
  50. package/dist/plotly-locale-hu.js +1 -1
  51. package/dist/plotly-locale-hy.js +1 -1
  52. package/dist/plotly-locale-id.js +1 -1
  53. package/dist/plotly-locale-is.js +1 -1
  54. package/dist/plotly-locale-it.js +1 -1
  55. package/dist/plotly-locale-ja.js +1 -1
  56. package/dist/plotly-locale-ka.js +1 -1
  57. package/dist/plotly-locale-km.js +1 -1
  58. package/dist/plotly-locale-ko.js +1 -1
  59. package/dist/plotly-locale-lt.js +1 -1
  60. package/dist/plotly-locale-lv.js +1 -1
  61. package/dist/plotly-locale-me-me.js +1 -1
  62. package/dist/plotly-locale-me.js +1 -1
  63. package/dist/plotly-locale-mk.js +1 -1
  64. package/dist/plotly-locale-ml.js +1 -1
  65. package/dist/plotly-locale-ms.js +1 -1
  66. package/dist/plotly-locale-mt.js +1 -1
  67. package/dist/plotly-locale-nl-be.js +1 -1
  68. package/dist/plotly-locale-nl.js +1 -1
  69. package/dist/plotly-locale-no.js +1 -1
  70. package/dist/plotly-locale-pa.js +1 -1
  71. package/dist/plotly-locale-pl.js +1 -1
  72. package/dist/plotly-locale-pt-br.js +1 -1
  73. package/dist/plotly-locale-rm.js +1 -1
  74. package/dist/plotly-locale-ro.js +1 -1
  75. package/dist/plotly-locale-ru.js +1 -1
  76. package/dist/plotly-locale-sk.js +1 -1
  77. package/dist/plotly-locale-sl.js +1 -1
  78. package/dist/plotly-locale-sq.js +1 -1
  79. package/dist/plotly-locale-sr-sr.js +1 -1
  80. package/dist/plotly-locale-sr.js +1 -1
  81. package/dist/plotly-locale-sv.js +1 -1
  82. package/dist/plotly-locale-sw.js +1 -1
  83. package/dist/plotly-locale-ta.js +1 -1
  84. package/dist/plotly-locale-th.js +1 -1
  85. package/dist/plotly-locale-tr.js +1 -1
  86. package/dist/plotly-locale-tt.js +1 -1
  87. package/dist/plotly-locale-uk.js +1 -1
  88. package/dist/plotly-locale-ur.js +1 -1
  89. package/dist/plotly-locale-vi.js +1 -1
  90. package/dist/plotly-locale-zh-cn.js +1 -1
  91. package/dist/plotly-locale-zh-hk.js +1 -1
  92. package/dist/plotly-locale-zh-tw.js +1 -1
  93. package/dist/plotly-mapbox.js +1749 -1849
  94. package/dist/plotly-mapbox.min.js +3 -3
  95. package/dist/plotly-with-meta.js +6225 -3884
  96. package/dist/plotly.js +5898 -3754
  97. package/dist/plotly.min.js +3 -3
  98. package/dist/translation-keys.txt +17 -17
  99. package/lib/aggregate.js +1 -1
  100. package/lib/bar.js +1 -1
  101. package/lib/barpolar.js +1 -1
  102. package/lib/box.js +1 -1
  103. package/lib/calendars.js +1 -1
  104. package/lib/candlestick.js +1 -1
  105. package/lib/carpet.js +1 -1
  106. package/lib/choropleth.js +1 -1
  107. package/lib/choroplethmapbox.js +1 -1
  108. package/lib/cone.js +1 -1
  109. package/lib/contour.js +1 -1
  110. package/lib/contourcarpet.js +1 -1
  111. package/lib/contourgl.js +1 -1
  112. package/lib/core.js +1 -1
  113. package/lib/densitymapbox.js +1 -1
  114. package/lib/filter.js +1 -1
  115. package/lib/funnel.js +1 -1
  116. package/lib/funnelarea.js +1 -1
  117. package/lib/groupby.js +1 -1
  118. package/lib/heatmap.js +1 -1
  119. package/lib/heatmapgl.js +1 -1
  120. package/lib/histogram.js +1 -1
  121. package/lib/histogram2d.js +1 -1
  122. package/lib/histogram2dcontour.js +1 -1
  123. package/lib/image.js +1 -1
  124. package/lib/index-basic.js +1 -1
  125. package/lib/index-cartesian.js +1 -1
  126. package/lib/index-finance.js +1 -1
  127. package/lib/index-geo.js +1 -1
  128. package/lib/index-gl2d.js +1 -1
  129. package/lib/index-gl3d.js +1 -1
  130. package/lib/index-mapbox.js +1 -1
  131. package/lib/index.js +1 -1
  132. package/lib/indicator.js +1 -1
  133. package/lib/isosurface.js +1 -1
  134. package/lib/locales/af.js +1 -1
  135. package/lib/locales/am.js +1 -1
  136. package/lib/locales/ar-dz.js +1 -1
  137. package/lib/locales/ar-eg.js +1 -1
  138. package/lib/locales/ar.js +1 -1
  139. package/lib/locales/az.js +1 -1
  140. package/lib/locales/bg.js +1 -1
  141. package/lib/locales/bs.js +1 -1
  142. package/lib/locales/ca.js +1 -1
  143. package/lib/locales/cs.js +1 -1
  144. package/lib/locales/cy.js +1 -1
  145. package/lib/locales/da.js +1 -1
  146. package/lib/locales/de-ch.js +1 -1
  147. package/lib/locales/de.js +1 -1
  148. package/lib/locales/el.js +1 -1
  149. package/lib/locales/eo.js +1 -1
  150. package/lib/locales/es-ar.js +1 -1
  151. package/lib/locales/es-pe.js +1 -1
  152. package/lib/locales/es.js +1 -1
  153. package/lib/locales/et.js +1 -1
  154. package/lib/locales/eu.js +1 -1
  155. package/lib/locales/fa.js +1 -1
  156. package/lib/locales/fi.js +1 -1
  157. package/lib/locales/fo.js +1 -1
  158. package/lib/locales/fr-ch.js +1 -1
  159. package/lib/locales/fr.js +1 -1
  160. package/lib/locales/gl.js +1 -1
  161. package/lib/locales/gu.js +1 -1
  162. package/lib/locales/he.js +1 -1
  163. package/lib/locales/hi-in.js +1 -1
  164. package/lib/locales/hr.js +1 -1
  165. package/lib/locales/hu.js +1 -1
  166. package/lib/locales/hy.js +1 -1
  167. package/lib/locales/id.js +1 -1
  168. package/lib/locales/is.js +1 -1
  169. package/lib/locales/it.js +1 -1
  170. package/lib/locales/ja.js +1 -1
  171. package/lib/locales/ka.js +1 -1
  172. package/lib/locales/km.js +1 -1
  173. package/lib/locales/ko.js +54 -2
  174. package/lib/locales/lt.js +1 -1
  175. package/lib/locales/lv.js +1 -1
  176. package/lib/locales/me-me.js +1 -1
  177. package/lib/locales/me.js +1 -1
  178. package/lib/locales/mk.js +1 -1
  179. package/lib/locales/ml.js +1 -1
  180. package/lib/locales/ms.js +1 -1
  181. package/lib/locales/mt.js +1 -1
  182. package/lib/locales/nl-be.js +1 -1
  183. package/lib/locales/nl.js +1 -1
  184. package/lib/locales/no.js +1 -1
  185. package/lib/locales/pa.js +1 -1
  186. package/lib/locales/pl.js +1 -1
  187. package/lib/locales/pt-br.js +1 -1
  188. package/lib/locales/rm.js +1 -1
  189. package/lib/locales/ro.js +1 -1
  190. package/lib/locales/ru.js +1 -1
  191. package/lib/locales/sk.js +1 -1
  192. package/lib/locales/sl.js +1 -1
  193. package/lib/locales/sq.js +1 -1
  194. package/lib/locales/sr-sr.js +1 -1
  195. package/lib/locales/sr.js +1 -1
  196. package/lib/locales/sv.js +1 -1
  197. package/lib/locales/sw.js +1 -1
  198. package/lib/locales/ta.js +1 -1
  199. package/lib/locales/th.js +1 -1
  200. package/lib/locales/tr.js +1 -1
  201. package/lib/locales/tt.js +1 -1
  202. package/lib/locales/uk.js +1 -1
  203. package/lib/locales/ur.js +1 -1
  204. package/lib/locales/vi.js +1 -1
  205. package/lib/locales/zh-cn.js +1 -1
  206. package/lib/locales/zh-hk.js +1 -1
  207. package/lib/locales/zh-tw.js +1 -1
  208. package/lib/mesh3d.js +1 -1
  209. package/lib/ohlc.js +1 -1
  210. package/lib/parcats.js +1 -1
  211. package/lib/parcoords.js +1 -1
  212. package/lib/pie.js +1 -1
  213. package/lib/pointcloud.js +1 -1
  214. package/lib/sankey.js +1 -1
  215. package/lib/scatter.js +1 -1
  216. package/lib/scatter3d.js +1 -1
  217. package/lib/scattercarpet.js +1 -1
  218. package/lib/scattergeo.js +1 -1
  219. package/lib/scattergl.js +1 -1
  220. package/lib/scattermapbox.js +1 -1
  221. package/lib/scatterpolar.js +1 -1
  222. package/lib/scatterpolargl.js +1 -1
  223. package/lib/scatterternary.js +1 -1
  224. package/lib/sort.js +1 -1
  225. package/lib/splom.js +1 -1
  226. package/lib/streamtube.js +1 -1
  227. package/lib/sunburst.js +1 -1
  228. package/lib/surface.js +1 -1
  229. package/lib/table.js +1 -1
  230. package/lib/treemap.js +1 -1
  231. package/lib/violin.js +1 -1
  232. package/lib/volume.js +1 -1
  233. package/lib/waterfall.js +1 -1
  234. package/package.json +25 -23
  235. package/src/assets/geo_assets.js +2 -2
  236. package/src/components/annotations/arrow_paths.js +1 -1
  237. package/src/components/annotations/attributes.js +2 -2
  238. package/src/components/annotations/calc_autorange.js +1 -1
  239. package/src/components/annotations/click.js +1 -1
  240. package/src/components/annotations/common_defaults.js +1 -1
  241. package/src/components/annotations/convert_coords.js +1 -1
  242. package/src/components/annotations/defaults.js +1 -1
  243. package/src/components/annotations/draw.js +1 -1
  244. package/src/components/annotations/draw_arrow_head.js +1 -1
  245. package/src/components/annotations/index.js +1 -1
  246. package/src/components/annotations3d/attributes.js +1 -1
  247. package/src/components/annotations3d/convert.js +1 -1
  248. package/src/components/annotations3d/defaults.js +1 -1
  249. package/src/components/annotations3d/draw.js +1 -1
  250. package/src/components/annotations3d/index.js +1 -1
  251. package/src/components/calendars/calendars.js +1 -1
  252. package/src/components/calendars/index.js +1 -1
  253. package/src/components/color/attributes.js +1 -1
  254. package/src/components/color/index.js +1 -1
  255. package/src/components/colorbar/attributes.js +1 -1
  256. package/src/components/colorbar/constants.js +1 -1
  257. package/src/components/colorbar/defaults.js +1 -1
  258. package/src/components/colorbar/draw.js +1 -1
  259. package/src/components/colorbar/has_colorbar.js +1 -1
  260. package/src/components/colorbar/index.js +1 -1
  261. package/src/components/colorscale/attributes.js +1 -1
  262. package/src/components/colorscale/calc.js +1 -1
  263. package/src/components/colorscale/cross_trace_defaults.js +1 -1
  264. package/src/components/colorscale/defaults.js +5 -2
  265. package/src/components/colorscale/helpers.js +1 -1
  266. package/src/components/colorscale/index.js +1 -1
  267. package/src/components/colorscale/layout_attributes.js +1 -1
  268. package/src/components/colorscale/layout_defaults.js +1 -1
  269. package/src/components/colorscale/scales.js +1 -1
  270. package/src/components/dragelement/align.js +1 -1
  271. package/src/components/dragelement/cursor.js +1 -1
  272. package/src/components/dragelement/index.js +1 -1
  273. package/src/components/dragelement/unhover.js +1 -1
  274. package/src/components/drawing/attributes.js +1 -1
  275. package/src/components/drawing/index.js +40 -15
  276. package/src/components/drawing/symbol_defs.js +1 -1
  277. package/src/components/errorbars/attributes.js +1 -1
  278. package/src/components/errorbars/calc.js +1 -1
  279. package/src/components/errorbars/compute_error.js +1 -1
  280. package/src/components/errorbars/defaults.js +1 -1
  281. package/src/components/errorbars/index.js +1 -1
  282. package/src/components/errorbars/plot.js +1 -1
  283. package/src/components/errorbars/style.js +1 -1
  284. package/src/components/fx/attributes.js +1 -1
  285. package/src/components/fx/calc.js +1 -1
  286. package/src/components/fx/click.js +1 -1
  287. package/src/components/fx/constants.js +1 -1
  288. package/src/components/fx/defaults.js +1 -1
  289. package/src/components/fx/helpers.js +1 -1
  290. package/src/components/fx/hover.js +1 -1
  291. package/src/components/fx/hoverlabel_defaults.js +1 -1
  292. package/src/components/fx/index.js +1 -1
  293. package/src/components/fx/layout_attributes.js +1 -1
  294. package/src/components/fx/layout_defaults.js +1 -1
  295. package/src/components/fx/layout_global_defaults.js +1 -1
  296. package/src/components/grid/index.js +1 -1
  297. package/src/components/images/attributes.js +1 -1
  298. package/src/components/images/convert_coords.js +1 -1
  299. package/src/components/images/defaults.js +1 -1
  300. package/src/components/images/draw.js +1 -1
  301. package/src/components/images/index.js +1 -1
  302. package/src/components/legend/attributes.js +34 -1
  303. package/src/components/legend/constants.js +3 -1
  304. package/src/components/legend/defaults.js +15 -2
  305. package/src/components/legend/draw.js +96 -29
  306. package/src/components/legend/get_legend_data.js +1 -1
  307. package/src/components/legend/handle_click.js +7 -4
  308. package/src/components/legend/helpers.js +1 -1
  309. package/src/components/legend/index.js +1 -1
  310. package/src/components/legend/style.js +128 -3
  311. package/src/components/modebar/buttons.js +43 -5
  312. package/src/components/modebar/index.js +1 -1
  313. package/src/components/modebar/manage.js +2 -1
  314. package/src/components/modebar/modebar.js +1 -1
  315. package/src/components/rangeselector/attributes.js +1 -1
  316. package/src/components/rangeselector/constants.js +1 -1
  317. package/src/components/rangeselector/defaults.js +1 -1
  318. package/src/components/rangeselector/draw.js +1 -1
  319. package/src/components/rangeselector/get_update_object.js +1 -1
  320. package/src/components/rangeselector/index.js +1 -1
  321. package/src/components/rangeslider/attributes.js +1 -1
  322. package/src/components/rangeslider/calc_autorange.js +1 -1
  323. package/src/components/rangeslider/constants.js +1 -1
  324. package/src/components/rangeslider/defaults.js +1 -1
  325. package/src/components/rangeslider/draw.js +1 -1
  326. package/src/components/rangeslider/helpers.js +1 -1
  327. package/src/components/rangeslider/index.js +1 -1
  328. package/src/components/rangeslider/oppaxis_attributes.js +1 -1
  329. package/src/components/shapes/attributes.js +1 -1
  330. package/src/components/shapes/calc_autorange.js +1 -1
  331. package/src/components/shapes/constants.js +1 -1
  332. package/src/components/shapes/defaults.js +1 -1
  333. package/src/components/shapes/draw.js +1 -1
  334. package/src/components/shapes/helpers.js +1 -1
  335. package/src/components/shapes/index.js +1 -1
  336. package/src/components/sliders/attributes.js +1 -1
  337. package/src/components/sliders/constants.js +1 -1
  338. package/src/components/sliders/defaults.js +1 -1
  339. package/src/components/sliders/draw.js +1 -1
  340. package/src/components/sliders/index.js +1 -1
  341. package/src/components/titles/index.js +1 -1
  342. package/src/components/updatemenus/attributes.js +1 -1
  343. package/src/components/updatemenus/constants.js +1 -1
  344. package/src/components/updatemenus/defaults.js +1 -1
  345. package/src/components/updatemenus/draw.js +1 -1
  346. package/src/components/updatemenus/index.js +1 -1
  347. package/src/components/updatemenus/scrollbox.js +1 -1
  348. package/src/constants/alignment.js +1 -1
  349. package/src/constants/delta.js +1 -1
  350. package/src/constants/docs.js +1 -1
  351. package/src/constants/filter_ops.js +1 -1
  352. package/src/constants/gl3d_dashes.js +1 -1
  353. package/src/constants/gl3d_markers.js +1 -1
  354. package/src/constants/interactions.js +1 -1
  355. package/src/constants/numerical.js +1 -1
  356. package/src/constants/xmlns_namespaces.js +1 -1
  357. package/src/core.js +8 -2
  358. package/src/fonts/mathjax_config.js +1 -1
  359. package/src/fonts/ploticon.js +1 -1
  360. package/src/lib/anchor_utils.js +1 -1
  361. package/src/lib/angles.js +1 -1
  362. package/src/lib/array.js +1 -1
  363. package/src/lib/clean_number.js +1 -1
  364. package/src/lib/clear_gl_canvases.js +1 -1
  365. package/src/lib/clear_responsive.js +1 -1
  366. package/src/lib/coerce.js +1 -1
  367. package/src/lib/dates.js +1 -1
  368. package/src/lib/dom.js +1 -1
  369. package/src/lib/events.js +1 -1
  370. package/src/lib/extend.js +1 -1
  371. package/src/lib/filter_unique.js +1 -1
  372. package/src/lib/filter_visible.js +1 -1
  373. package/src/lib/geo_location_utils.js +312 -7
  374. package/src/lib/geojson_utils.js +1 -1
  375. package/src/lib/geometry2d.js +1 -1
  376. package/src/lib/gl_format_color.js +1 -1
  377. package/src/lib/gup.js +1 -1
  378. package/src/lib/identity.js +1 -1
  379. package/src/lib/index.js +57 -31
  380. package/src/lib/is_plain_object.js +1 -1
  381. package/src/lib/keyed_container.js +1 -1
  382. package/src/lib/localize.js +1 -1
  383. package/src/lib/loggers.js +36 -10
  384. package/src/lib/make_trace_groups.js +1 -1
  385. package/src/lib/matrix.js +1 -1
  386. package/src/lib/mod.js +1 -1
  387. package/src/lib/nested_property.js +1 -1
  388. package/src/lib/noop.js +1 -1
  389. package/src/lib/notifier.js +13 -7
  390. package/src/lib/override_cursor.js +1 -1
  391. package/src/lib/polygon.js +1 -1
  392. package/src/lib/prepare_regl.js +1 -1
  393. package/src/lib/push_unique.js +1 -1
  394. package/src/lib/queue.js +1 -1
  395. package/src/lib/regex.js +1 -1
  396. package/src/lib/relative_attr.js +1 -1
  397. package/src/lib/relink_private.js +1 -1
  398. package/src/lib/search.js +1 -1
  399. package/src/lib/setcursor.js +1 -1
  400. package/src/lib/show_no_webgl_msg.js +1 -1
  401. package/src/lib/stats.js +1 -1
  402. package/src/lib/str2rgbarray.js +1 -1
  403. package/src/lib/svg_text_utils.js +1 -1
  404. package/src/lib/throttle.js +1 -1
  405. package/src/lib/to_log_range.js +1 -1
  406. package/src/lib/topojson_utils.js +1 -1
  407. package/src/locale-en-us.js +1 -1
  408. package/src/locale-en.js +1 -1
  409. package/src/plot_api/container_array_match.js +1 -1
  410. package/src/plot_api/edit_types.js +1 -1
  411. package/src/plot_api/helpers.js +1 -1
  412. package/src/plot_api/index.js +1 -1
  413. package/src/plot_api/manage_arrays.js +1 -1
  414. package/src/plot_api/plot_api.js +2 -2
  415. package/src/plot_api/plot_config.js +19 -2
  416. package/src/plot_api/plot_schema.js +1 -1
  417. package/src/plot_api/plot_template.js +1 -1
  418. package/src/plot_api/subroutines.js +7 -1
  419. package/src/plot_api/template_api.js +1 -1
  420. package/src/plot_api/to_image.js +1 -1
  421. package/src/plot_api/validate.js +5 -4
  422. package/src/plots/animation_attributes.js +1 -1
  423. package/src/plots/array_container_defaults.js +1 -1
  424. package/src/plots/attributes.js +1 -1
  425. package/src/plots/cartesian/attributes.js +1 -1
  426. package/src/plots/cartesian/autorange.js +1 -1
  427. package/src/plots/cartesian/axes.js +7 -3
  428. package/src/plots/cartesian/axis_autotype.js +1 -1
  429. package/src/plots/cartesian/axis_defaults.js +1 -1
  430. package/src/plots/cartesian/axis_ids.js +1 -1
  431. package/src/plots/cartesian/category_order_defaults.js +1 -1
  432. package/src/plots/cartesian/clean_ticks.js +1 -1
  433. package/src/plots/cartesian/constants.js +2 -3
  434. package/src/plots/cartesian/constraints.js +1 -1
  435. package/src/plots/cartesian/dragbox.js +1 -1
  436. package/src/plots/cartesian/graph_interact.js +1 -1
  437. package/src/plots/cartesian/include_components.js +1 -1
  438. package/src/plots/cartesian/index.js +1 -1
  439. package/src/plots/cartesian/layout_attributes.js +1 -1
  440. package/src/plots/cartesian/layout_defaults.js +113 -28
  441. package/src/plots/cartesian/line_grid_defaults.js +1 -1
  442. package/src/plots/cartesian/position_defaults.js +1 -1
  443. package/src/plots/cartesian/scale_zoom.js +1 -1
  444. package/src/plots/cartesian/select.js +1 -1
  445. package/src/plots/cartesian/set_convert.js +1 -1
  446. package/src/plots/cartesian/tick_label_defaults.js +1 -1
  447. package/src/plots/cartesian/tick_mark_defaults.js +1 -1
  448. package/src/plots/cartesian/tick_value_defaults.js +1 -1
  449. package/src/plots/cartesian/transition_axes.js +1 -1
  450. package/src/plots/cartesian/type_defaults.js +11 -3
  451. package/src/plots/command.js +1 -1
  452. package/src/plots/domain.js +1 -1
  453. package/src/plots/font_attributes.js +1 -1
  454. package/src/plots/frame_attributes.js +1 -1
  455. package/src/plots/geo/constants.js +1 -1
  456. package/src/plots/geo/geo.js +114 -51
  457. package/src/plots/geo/index.js +1 -1
  458. package/src/plots/geo/layout_attributes.js +34 -1
  459. package/src/plots/geo/layout_defaults.js +80 -15
  460. package/src/plots/geo/projections.js +1 -1
  461. package/src/plots/geo/zoom.js +2 -2
  462. package/src/plots/get_data.js +1 -1
  463. package/src/plots/gl2d/camera.js +1 -1
  464. package/src/plots/gl2d/convert.js +1 -1
  465. package/src/plots/gl2d/index.js +1 -1
  466. package/src/plots/gl2d/scene2d.js +1 -1
  467. package/src/plots/gl3d/index.js +1 -1
  468. package/src/plots/gl3d/layout/attributes.js +1 -1
  469. package/src/plots/gl3d/layout/axis_attributes.js +1 -1
  470. package/src/plots/gl3d/layout/axis_defaults.js +1 -1
  471. package/src/plots/gl3d/layout/convert.js +1 -1
  472. package/src/plots/gl3d/layout/defaults.js +1 -1
  473. package/src/plots/gl3d/layout/layout_attributes.js +1 -1
  474. package/src/plots/gl3d/layout/spikes.js +1 -1
  475. package/src/plots/gl3d/layout/tick_marks.js +1 -1
  476. package/src/plots/gl3d/project.js +1 -1
  477. package/src/plots/gl3d/scene.js +362 -324
  478. package/src/plots/gl3d/zip3.js +1 -1
  479. package/src/plots/layout_attributes.js +33 -3
  480. package/src/plots/mapbox/constants.js +1 -1
  481. package/src/plots/mapbox/convert_text_opts.js +1 -1
  482. package/src/plots/mapbox/index.js +2 -1
  483. package/src/plots/mapbox/layers.js +28 -1
  484. package/src/plots/mapbox/layout_attributes.js +1 -1
  485. package/src/plots/mapbox/layout_defaults.js +1 -1
  486. package/src/plots/mapbox/mapbox.js +46 -54
  487. package/src/plots/pad_attributes.js +1 -1
  488. package/src/plots/plots.js +55 -14
  489. package/src/plots/polar/constants.js +1 -1
  490. package/src/plots/polar/helpers.js +1 -1
  491. package/src/plots/polar/index.js +1 -1
  492. package/src/plots/polar/layout_attributes.js +1 -1
  493. package/src/plots/polar/layout_defaults.js +1 -1
  494. package/src/plots/polar/legacy/area_attributes.js +1 -1
  495. package/src/plots/polar/legacy/axis_attributes.js +1 -1
  496. package/src/plots/polar/legacy/index.js +1 -1
  497. package/src/plots/polar/legacy/micropolar.js +1 -1
  498. package/src/plots/polar/legacy/micropolar_manager.js +1 -1
  499. package/src/plots/polar/legacy/undo_manager.js +1 -1
  500. package/src/plots/polar/polar.js +1 -1
  501. package/src/plots/polar/set_convert.js +1 -1
  502. package/src/plots/subplot_defaults.js +1 -1
  503. package/src/plots/template_attributes.js +1 -1
  504. package/src/plots/ternary/index.js +1 -1
  505. package/src/plots/ternary/layout_attributes.js +1 -1
  506. package/src/plots/ternary/layout_defaults.js +1 -1
  507. package/src/plots/ternary/ternary.js +1 -1
  508. package/src/registry.js +1 -1
  509. package/src/snapshot/cloneplot.js +1 -1
  510. package/src/snapshot/download.js +1 -1
  511. package/src/snapshot/filesaver.js +1 -1
  512. package/src/snapshot/helpers.js +1 -1
  513. package/src/snapshot/index.js +1 -1
  514. package/src/snapshot/svgtoimg.js +1 -1
  515. package/src/snapshot/toimage.js +1 -1
  516. package/src/snapshot/tosvg.js +21 -13
  517. package/src/traces/bar/arrays_to_calcdata.js +1 -1
  518. package/src/traces/bar/attributes.js +1 -1
  519. package/src/traces/bar/calc.js +1 -1
  520. package/src/traces/bar/constants.js +1 -1
  521. package/src/traces/bar/cross_trace_calc.js +1 -1
  522. package/src/traces/bar/defaults.js +10 -2
  523. package/src/traces/bar/event_data.js +1 -1
  524. package/src/traces/bar/helpers.js +1 -1
  525. package/src/traces/bar/hover.js +7 -2
  526. package/src/traces/bar/index.js +1 -1
  527. package/src/traces/bar/layout_attributes.js +1 -1
  528. package/src/traces/bar/layout_defaults.js +1 -1
  529. package/src/traces/bar/plot.js +139 -91
  530. package/src/traces/bar/select.js +1 -1
  531. package/src/traces/bar/sieve.js +1 -1
  532. package/src/traces/bar/style.js +9 -4
  533. package/src/traces/bar/style_defaults.js +1 -1
  534. package/src/traces/bar/uniform_text.js +84 -0
  535. package/src/traces/barpolar/attributes.js +1 -1
  536. package/src/traces/barpolar/calc.js +1 -1
  537. package/src/traces/barpolar/defaults.js +1 -1
  538. package/src/traces/barpolar/hover.js +1 -1
  539. package/src/traces/barpolar/index.js +1 -1
  540. package/src/traces/barpolar/layout_attributes.js +1 -1
  541. package/src/traces/barpolar/layout_defaults.js +1 -1
  542. package/src/traces/barpolar/plot.js +1 -1
  543. package/src/traces/box/attributes.js +204 -42
  544. package/src/traces/box/calc.js +286 -92
  545. package/src/traces/box/cross_trace_calc.js +1 -1
  546. package/src/traces/box/defaults.js +186 -22
  547. package/src/traces/box/event_data.js +1 -1
  548. package/src/traces/box/hover.js +1 -1
  549. package/src/traces/box/index.js +25 -12
  550. package/src/traces/box/layout_attributes.js +1 -1
  551. package/src/traces/box/layout_defaults.js +1 -1
  552. package/src/traces/box/plot.js +1 -1
  553. package/src/traces/box/select.js +1 -1
  554. package/src/traces/box/style.js +1 -1
  555. package/src/traces/candlestick/attributes.js +1 -1
  556. package/src/traces/candlestick/calc.js +1 -1
  557. package/src/traces/candlestick/defaults.js +1 -1
  558. package/src/traces/candlestick/index.js +1 -1
  559. package/src/traces/carpet/ab_defaults.js +1 -1
  560. package/src/traces/carpet/array_minmax.js +1 -1
  561. package/src/traces/carpet/attributes.js +1 -1
  562. package/src/traces/carpet/axis_aligned_line.js +1 -1
  563. package/src/traces/carpet/axis_attributes.js +1 -1
  564. package/src/traces/carpet/axis_defaults.js +1 -1
  565. package/src/traces/carpet/calc.js +1 -1
  566. package/src/traces/carpet/calc_clippath.js +1 -1
  567. package/src/traces/carpet/calc_gridlines.js +1 -1
  568. package/src/traces/carpet/calc_labels.js +1 -1
  569. package/src/traces/carpet/catmull_rom.js +1 -1
  570. package/src/traces/carpet/cheater_basis.js +1 -1
  571. package/src/traces/carpet/compute_control_points.js +1 -1
  572. package/src/traces/carpet/constants.js +1 -1
  573. package/src/traces/carpet/create_i_derivative_evaluator.js +1 -1
  574. package/src/traces/carpet/create_j_derivative_evaluator.js +1 -1
  575. package/src/traces/carpet/create_spline_evaluator.js +1 -1
  576. package/src/traces/carpet/defaults.js +1 -1
  577. package/src/traces/carpet/index.js +1 -1
  578. package/src/traces/carpet/lookup_carpetid.js +1 -1
  579. package/src/traces/carpet/makepath.js +1 -1
  580. package/src/traces/carpet/map_1d_array.js +1 -1
  581. package/src/traces/carpet/orient_text.js +1 -1
  582. package/src/traces/carpet/plot.js +1 -1
  583. package/src/traces/carpet/set_convert.js +1 -1
  584. package/src/traces/carpet/smooth_fill_2d_array.js +1 -1
  585. package/src/traces/carpet/smooth_fill_array.js +1 -1
  586. package/src/traces/carpet/xy_defaults.js +1 -1
  587. package/src/traces/choropleth/attributes.js +18 -2
  588. package/src/traces/choropleth/calc.js +1 -1
  589. package/src/traces/choropleth/defaults.js +13 -3
  590. package/src/traces/choropleth/event_data.js +4 -2
  591. package/src/traces/choropleth/hover.js +1 -1
  592. package/src/traces/choropleth/index.js +3 -2
  593. package/src/traces/choropleth/plot.js +39 -122
  594. package/src/traces/choropleth/select.js +1 -1
  595. package/src/traces/choropleth/style.js +1 -1
  596. package/src/traces/choroplethmapbox/attributes.js +16 -9
  597. package/src/traces/choroplethmapbox/convert.js +17 -106
  598. package/src/traces/choroplethmapbox/defaults.js +3 -1
  599. package/src/traces/choroplethmapbox/index.js +2 -2
  600. package/src/traces/choroplethmapbox/plot.js +1 -1
  601. package/src/traces/cone/attributes.js +4 -2
  602. package/src/traces/cone/calc.js +1 -1
  603. package/src/traces/cone/convert.js +1 -1
  604. package/src/traces/cone/defaults.js +1 -1
  605. package/src/traces/cone/index.js +2 -2
  606. package/src/traces/contour/attributes.js +1 -1
  607. package/src/traces/contour/calc.js +1 -1
  608. package/src/traces/contour/close_boundaries.js +1 -1
  609. package/src/traces/contour/colorbar.js +6 -4
  610. package/src/traces/contour/constants.js +1 -1
  611. package/src/traces/contour/constraint_defaults.js +1 -1
  612. package/src/traces/contour/constraint_mapping.js +1 -1
  613. package/src/traces/contour/contours_defaults.js +1 -1
  614. package/src/traces/contour/convert_to_constraints.js +1 -1
  615. package/src/traces/contour/defaults.js +1 -1
  616. package/src/traces/contour/empty_pathinfo.js +1 -1
  617. package/src/traces/contour/end_plus.js +1 -1
  618. package/src/traces/contour/find_all_paths.js +1 -1
  619. package/src/traces/contour/hover.js +1 -1
  620. package/src/traces/contour/index.js +1 -1
  621. package/src/traces/contour/label_defaults.js +1 -1
  622. package/src/traces/contour/make_color_map.js +1 -1
  623. package/src/traces/contour/make_crossings.js +1 -1
  624. package/src/traces/contour/plot.js +1 -1
  625. package/src/traces/contour/set_contours.js +1 -1
  626. package/src/traces/contour/style.js +1 -1
  627. package/src/traces/contour/style_defaults.js +1 -1
  628. package/src/traces/contourcarpet/attributes.js +1 -1
  629. package/src/traces/contourcarpet/calc.js +1 -1
  630. package/src/traces/contourcarpet/defaults.js +1 -1
  631. package/src/traces/contourcarpet/index.js +1 -1
  632. package/src/traces/contourcarpet/plot.js +1 -1
  633. package/src/traces/contourgl/convert.js +1 -1
  634. package/src/traces/contourgl/index.js +1 -1
  635. package/src/traces/densitymapbox/attributes.js +3 -2
  636. package/src/traces/densitymapbox/calc.js +1 -1
  637. package/src/traces/densitymapbox/convert.js +1 -1
  638. package/src/traces/densitymapbox/defaults.js +1 -1
  639. package/src/traces/densitymapbox/event_data.js +1 -1
  640. package/src/traces/densitymapbox/hover.js +1 -1
  641. package/src/traces/densitymapbox/index.js +2 -2
  642. package/src/traces/densitymapbox/plot.js +1 -1
  643. package/src/traces/funnel/arrays_to_calcdata.js +1 -1
  644. package/src/traces/funnel/attributes.js +1 -1
  645. package/src/traces/funnel/calc.js +1 -1
  646. package/src/traces/funnel/constants.js +1 -1
  647. package/src/traces/funnel/cross_trace_calc.js +1 -1
  648. package/src/traces/funnel/defaults.js +1 -1
  649. package/src/traces/funnel/event_data.js +1 -1
  650. package/src/traces/funnel/hover.js +1 -1
  651. package/src/traces/funnel/index.js +1 -1
  652. package/src/traces/funnel/layout_attributes.js +1 -1
  653. package/src/traces/funnel/layout_defaults.js +1 -1
  654. package/src/traces/funnel/plot.js +6 -3
  655. package/src/traces/funnel/style.js +5 -3
  656. package/src/traces/funnelarea/attributes.js +1 -1
  657. package/src/traces/funnelarea/base_plot.js +1 -1
  658. package/src/traces/funnelarea/calc.js +1 -1
  659. package/src/traces/funnelarea/defaults.js +11 -9
  660. package/src/traces/funnelarea/index.js +1 -1
  661. package/src/traces/funnelarea/layout_attributes.js +1 -1
  662. package/src/traces/funnelarea/layout_defaults.js +1 -1
  663. package/src/traces/funnelarea/plot.js +23 -14
  664. package/src/traces/funnelarea/style.js +6 -2
  665. package/src/traces/heatmap/attributes.js +4 -2
  666. package/src/traces/heatmap/calc.js +1 -1
  667. package/src/traces/heatmap/clean_2d_array.js +1 -1
  668. package/src/traces/heatmap/colorbar.js +1 -1
  669. package/src/traces/heatmap/convert_column_xyz.js +6 -1
  670. package/src/traces/heatmap/defaults.js +1 -1
  671. package/src/traces/heatmap/find_empties.js +1 -1
  672. package/src/traces/heatmap/hover.js +2 -2
  673. package/src/traces/heatmap/index.js +2 -2
  674. package/src/traces/heatmap/interp2d.js +1 -1
  675. package/src/traces/heatmap/make_bound_array.js +1 -1
  676. package/src/traces/heatmap/plot.js +1 -1
  677. package/src/traces/heatmap/style.js +1 -1
  678. package/src/traces/heatmap/style_defaults.js +1 -1
  679. package/src/traces/heatmap/xyz_defaults.js +1 -1
  680. package/src/traces/heatmapgl/attributes.js +1 -1
  681. package/src/traces/heatmapgl/convert.js +1 -1
  682. package/src/traces/heatmapgl/index.js +1 -1
  683. package/src/traces/histogram/attributes.js +1 -1
  684. package/src/traces/histogram/average.js +1 -1
  685. package/src/traces/histogram/bin_attributes.js +1 -1
  686. package/src/traces/histogram/bin_functions.js +1 -1
  687. package/src/traces/histogram/bin_label_vals.js +1 -1
  688. package/src/traces/histogram/calc.js +1 -1
  689. package/src/traces/histogram/constants.js +1 -1
  690. package/src/traces/histogram/cross_trace_defaults.js +2 -2
  691. package/src/traces/histogram/defaults.js +1 -1
  692. package/src/traces/histogram/event_data.js +1 -1
  693. package/src/traces/histogram/hover.js +1 -1
  694. package/src/traces/histogram/index.js +1 -1
  695. package/src/traces/histogram/norm_functions.js +1 -1
  696. package/src/traces/histogram2d/attributes.js +4 -2
  697. package/src/traces/histogram2d/calc.js +1 -1
  698. package/src/traces/histogram2d/defaults.js +1 -1
  699. package/src/traces/histogram2d/hover.js +1 -1
  700. package/src/traces/histogram2d/index.js +2 -3
  701. package/src/traces/histogram2d/sample_defaults.js +1 -1
  702. package/src/traces/histogram2dcontour/attributes.js +1 -1
  703. package/src/traces/histogram2dcontour/defaults.js +1 -1
  704. package/src/traces/histogram2dcontour/index.js +1 -1
  705. package/src/traces/image/attributes.js +1 -1
  706. package/src/traces/image/calc.js +1 -1
  707. package/src/traces/image/constants.js +1 -1
  708. package/src/traces/image/defaults.js +1 -1
  709. package/src/traces/image/event_data.js +1 -1
  710. package/src/traces/image/hover.js +1 -1
  711. package/src/traces/image/index.js +1 -1
  712. package/src/traces/image/plot.js +1 -1
  713. package/src/traces/image/style.js +1 -1
  714. package/src/traces/indicator/attributes.js +1 -1
  715. package/src/traces/indicator/base_plot.js +1 -1
  716. package/src/traces/indicator/calc.js +1 -1
  717. package/src/traces/indicator/constants.js +1 -1
  718. package/src/traces/indicator/defaults.js +1 -1
  719. package/src/traces/indicator/index.js +1 -1
  720. package/src/traces/indicator/plot.js +1 -1
  721. package/src/traces/isosurface/attributes.js +3 -2
  722. package/src/traces/isosurface/calc.js +23 -6
  723. package/src/traces/isosurface/convert.js +54 -44
  724. package/src/traces/isosurface/defaults.js +1 -1
  725. package/src/traces/isosurface/index.js +2 -2
  726. package/src/traces/mesh3d/attributes.js +16 -4
  727. package/src/traces/mesh3d/calc.js +1 -1
  728. package/src/traces/mesh3d/convert.js +13 -8
  729. package/src/traces/mesh3d/defaults.js +2 -1
  730. package/src/traces/mesh3d/index.js +2 -2
  731. package/src/traces/ohlc/attributes.js +1 -1
  732. package/src/traces/ohlc/calc.js +1 -1
  733. package/src/traces/ohlc/defaults.js +1 -1
  734. package/src/traces/ohlc/hover.js +1 -1
  735. package/src/traces/ohlc/index.js +1 -1
  736. package/src/traces/ohlc/ohlc_defaults.js +1 -1
  737. package/src/traces/ohlc/plot.js +1 -1
  738. package/src/traces/ohlc/select.js +1 -1
  739. package/src/traces/ohlc/style.js +1 -1
  740. package/src/traces/parcats/attributes.js +1 -1
  741. package/src/traces/parcats/base_plot.js +1 -1
  742. package/src/traces/parcats/calc.js +1 -1
  743. package/src/traces/parcats/defaults.js +1 -1
  744. package/src/traces/parcats/index.js +1 -1
  745. package/src/traces/parcats/parcats.js +1 -1
  746. package/src/traces/parcats/plot.js +1 -1
  747. package/src/traces/parcoords/attributes.js +1 -1
  748. package/src/traces/parcoords/axisbrush.js +1 -1
  749. package/src/traces/parcoords/base_plot.js +1 -1
  750. package/src/traces/parcoords/calc.js +1 -1
  751. package/src/traces/parcoords/constants.js +1 -1
  752. package/src/traces/parcoords/defaults.js +1 -1
  753. package/src/traces/parcoords/helpers.js +1 -1
  754. package/src/traces/parcoords/index.js +1 -1
  755. package/src/traces/parcoords/lines.js +1 -1
  756. package/src/traces/parcoords/merge_length.js +1 -1
  757. package/src/traces/parcoords/parcoords.js +1 -1
  758. package/src/traces/parcoords/plot.js +1 -1
  759. package/src/traces/pie/attributes.js +17 -1
  760. package/src/traces/pie/base_plot.js +1 -1
  761. package/src/traces/pie/calc.js +7 -8
  762. package/src/traces/pie/defaults.js +50 -10
  763. package/src/traces/pie/event_data.js +1 -1
  764. package/src/traces/pie/helpers.js +1 -1
  765. package/src/traces/pie/index.js +2 -2
  766. package/src/traces/pie/layout_attributes.js +1 -1
  767. package/src/traces/pie/layout_defaults.js +1 -1
  768. package/src/traces/pie/plot.js +196 -72
  769. package/src/traces/pie/style.js +6 -2
  770. package/src/traces/pie/style_one.js +1 -1
  771. package/src/traces/pointcloud/attributes.js +1 -1
  772. package/src/traces/pointcloud/convert.js +1 -1
  773. package/src/traces/pointcloud/defaults.js +1 -1
  774. package/src/traces/pointcloud/index.js +1 -1
  775. package/src/traces/sankey/attributes.js +1 -1
  776. package/src/traces/sankey/base_plot.js +1 -1
  777. package/src/traces/sankey/calc.js +1 -1
  778. package/src/traces/sankey/constants.js +1 -1
  779. package/src/traces/sankey/defaults.js +1 -1
  780. package/src/traces/sankey/index.js +1 -1
  781. package/src/traces/sankey/plot.js +10 -6
  782. package/src/traces/sankey/render.js +1 -1
  783. package/src/traces/sankey/select.js +1 -1
  784. package/src/traces/scatter/arrays_to_calcdata.js +1 -1
  785. package/src/traces/scatter/attributes.js +1 -1
  786. package/src/traces/scatter/calc.js +1 -1
  787. package/src/traces/scatter/calc_selection.js +1 -1
  788. package/src/traces/scatter/colorscale_calc.js +1 -1
  789. package/src/traces/scatter/constants.js +1 -1
  790. package/src/traces/scatter/cross_trace_calc.js +1 -1
  791. package/src/traces/scatter/cross_trace_defaults.js +1 -1
  792. package/src/traces/scatter/defaults.js +1 -1
  793. package/src/traces/scatter/fillcolor_defaults.js +1 -1
  794. package/src/traces/scatter/format_labels.js +1 -1
  795. package/src/traces/scatter/get_trace_color.js +1 -1
  796. package/src/traces/scatter/hover.js +1 -1
  797. package/src/traces/scatter/index.js +1 -1
  798. package/src/traces/scatter/line_defaults.js +1 -1
  799. package/src/traces/scatter/line_points.js +1 -1
  800. package/src/traces/scatter/line_shape_defaults.js +1 -1
  801. package/src/traces/scatter/link_traces.js +1 -1
  802. package/src/traces/scatter/make_bubble_size_func.js +1 -1
  803. package/src/traces/scatter/marker_colorbar.js +1 -1
  804. package/src/traces/scatter/marker_defaults.js +1 -1
  805. package/src/traces/scatter/plot.js +1 -1
  806. package/src/traces/scatter/select.js +1 -1
  807. package/src/traces/scatter/stack_defaults.js +1 -1
  808. package/src/traces/scatter/style.js +1 -1
  809. package/src/traces/scatter/subtypes.js +1 -1
  810. package/src/traces/scatter/text_defaults.js +1 -1
  811. package/src/traces/scatter/xy_defaults.js +1 -1
  812. package/src/traces/scatter3d/attributes.js +1 -1
  813. package/src/traces/scatter3d/calc.js +1 -1
  814. package/src/traces/scatter3d/calc_errors.js +1 -1
  815. package/src/traces/scatter3d/convert.js +1 -1
  816. package/src/traces/scatter3d/defaults.js +1 -1
  817. package/src/traces/scatter3d/index.js +1 -1
  818. package/src/traces/scattercarpet/attributes.js +1 -1
  819. package/src/traces/scattercarpet/calc.js +1 -1
  820. package/src/traces/scattercarpet/defaults.js +1 -1
  821. package/src/traces/scattercarpet/event_data.js +1 -1
  822. package/src/traces/scattercarpet/format_labels.js +1 -1
  823. package/src/traces/scattercarpet/hover.js +1 -1
  824. package/src/traces/scattercarpet/index.js +1 -1
  825. package/src/traces/scattercarpet/plot.js +1 -1
  826. package/src/traces/scattergeo/attributes.js +35 -3
  827. package/src/traces/scattergeo/calc.js +13 -2
  828. package/src/traces/scattergeo/defaults.js +26 -24
  829. package/src/traces/scattergeo/event_data.js +8 -2
  830. package/src/traces/scattergeo/format_labels.js +1 -1
  831. package/src/traces/scattergeo/hover.js +1 -1
  832. package/src/traces/scattergeo/index.js +3 -2
  833. package/src/traces/scattergeo/plot.js +55 -20
  834. package/src/traces/scattergeo/select.js +1 -1
  835. package/src/traces/scattergeo/style.js +1 -1
  836. package/src/traces/scattergl/attributes.js +1 -1
  837. package/src/traces/scattergl/calc.js +1 -1
  838. package/src/traces/scattergl/constants.js +1 -1
  839. package/src/traces/scattergl/convert.js +14 -10
  840. package/src/traces/scattergl/defaults.js +3 -2
  841. package/src/traces/scattergl/edit_style.js +1 -1
  842. package/src/traces/scattergl/format_labels.js +1 -1
  843. package/src/traces/scattergl/helpers.js +23 -0
  844. package/src/traces/scattergl/hover.js +5 -5
  845. package/src/traces/scattergl/index.js +1 -1
  846. package/src/traces/scattergl/plot.js +1 -1
  847. package/src/traces/scattergl/scene_update.js +1 -1
  848. package/src/traces/scattergl/select.js +1 -1
  849. package/src/traces/scattermapbox/attributes.js +1 -1
  850. package/src/traces/scattermapbox/convert.js +1 -1
  851. package/src/traces/scattermapbox/defaults.js +1 -1
  852. package/src/traces/scattermapbox/event_data.js +1 -1
  853. package/src/traces/scattermapbox/format_labels.js +1 -1
  854. package/src/traces/scattermapbox/hover.js +1 -1
  855. package/src/traces/scattermapbox/index.js +1 -1
  856. package/src/traces/scattermapbox/plot.js +1 -1
  857. package/src/traces/scattermapbox/select.js +1 -1
  858. package/src/traces/scatterpolar/attributes.js +1 -1
  859. package/src/traces/scatterpolar/calc.js +1 -1
  860. package/src/traces/scatterpolar/defaults.js +1 -1
  861. package/src/traces/scatterpolar/format_labels.js +1 -1
  862. package/src/traces/scatterpolar/hover.js +1 -1
  863. package/src/traces/scatterpolar/index.js +1 -1
  864. package/src/traces/scatterpolar/plot.js +1 -1
  865. package/src/traces/scatterpolargl/attributes.js +1 -1
  866. package/src/traces/scatterpolargl/calc.js +1 -1
  867. package/src/traces/scatterpolargl/defaults.js +1 -1
  868. package/src/traces/scatterpolargl/format_labels.js +1 -1
  869. package/src/traces/scatterpolargl/hover.js +1 -1
  870. package/src/traces/scatterpolargl/index.js +1 -1
  871. package/src/traces/scatterpolargl/plot.js +1 -1
  872. package/src/traces/scatterternary/attributes.js +1 -1
  873. package/src/traces/scatterternary/calc.js +1 -1
  874. package/src/traces/scatterternary/defaults.js +1 -1
  875. package/src/traces/scatterternary/event_data.js +1 -1
  876. package/src/traces/scatterternary/format_labels.js +1 -1
  877. package/src/traces/scatterternary/hover.js +1 -1
  878. package/src/traces/scatterternary/index.js +1 -1
  879. package/src/traces/scatterternary/plot.js +1 -1
  880. package/src/traces/splom/attributes.js +1 -1
  881. package/src/traces/splom/base_plot.js +1 -1
  882. package/src/traces/splom/calc.js +1 -1
  883. package/src/traces/splom/defaults.js +3 -3
  884. package/src/traces/splom/edit_style.js +1 -1
  885. package/src/traces/splom/helpers.js +1 -1
  886. package/src/traces/splom/hover.js +1 -1
  887. package/src/traces/splom/index.js +1 -1
  888. package/src/traces/splom/plot.js +1 -1
  889. package/src/traces/splom/scene_update.js +1 -1
  890. package/src/traces/splom/select.js +1 -1
  891. package/src/traces/streamtube/attributes.js +3 -2
  892. package/src/traces/streamtube/calc.js +112 -54
  893. package/src/traces/streamtube/convert.js +7 -7
  894. package/src/traces/streamtube/defaults.js +1 -1
  895. package/src/traces/streamtube/index.js +3 -3
  896. package/src/traces/sunburst/attributes.js +11 -2
  897. package/src/traces/sunburst/base_plot.js +1 -1
  898. package/src/traces/sunburst/calc.js +4 -2
  899. package/src/traces/sunburst/constants.js +1 -1
  900. package/src/traces/sunburst/defaults.js +7 -2
  901. package/src/traces/sunburst/fx.js +24 -23
  902. package/src/traces/sunburst/helpers.js +16 -9
  903. package/src/traces/sunburst/index.js +1 -1
  904. package/src/traces/sunburst/layout_attributes.js +1 -1
  905. package/src/traces/sunburst/layout_defaults.js +1 -1
  906. package/src/traces/sunburst/plot.js +52 -25
  907. package/src/traces/sunburst/style.js +6 -2
  908. package/src/traces/surface/attributes.js +3 -2
  909. package/src/traces/surface/calc.js +1 -1
  910. package/src/traces/surface/convert.js +1 -1
  911. package/src/traces/surface/defaults.js +1 -1
  912. package/src/traces/surface/index.js +2 -2
  913. package/src/traces/table/attributes.js +1 -1
  914. package/src/traces/table/base_plot.js +1 -1
  915. package/src/traces/table/calc.js +1 -1
  916. package/src/traces/table/constants.js +1 -1
  917. package/src/traces/table/data_preparation_helper.js +1 -1
  918. package/src/traces/table/data_split_helpers.js +1 -1
  919. package/src/traces/table/defaults.js +1 -1
  920. package/src/traces/table/index.js +1 -1
  921. package/src/traces/table/plot.js +1 -1
  922. package/src/traces/treemap/attributes.js +10 -2
  923. package/src/traces/treemap/base_plot.js +1 -1
  924. package/src/traces/treemap/calc.js +1 -1
  925. package/src/traces/treemap/constants.js +1 -1
  926. package/src/traces/treemap/defaults.js +8 -5
  927. package/src/traces/treemap/draw_ancestors.js +9 -11
  928. package/src/traces/treemap/draw_descendants.js +6 -2
  929. package/src/traces/treemap/index.js +1 -1
  930. package/src/traces/treemap/layout_attributes.js +1 -1
  931. package/src/traces/treemap/layout_defaults.js +1 -1
  932. package/src/traces/treemap/partition.js +1 -1
  933. package/src/traces/treemap/plot.js +62 -47
  934. package/src/traces/treemap/style.js +6 -2
  935. package/src/traces/violin/attributes.js +5 -2
  936. package/src/traces/violin/calc.js +1 -1
  937. package/src/traces/violin/cross_trace_calc.js +1 -1
  938. package/src/traces/violin/defaults.js +1 -1
  939. package/src/traces/violin/helpers.js +1 -1
  940. package/src/traces/violin/hover.js +1 -1
  941. package/src/traces/violin/index.js +1 -1
  942. package/src/traces/violin/layout_attributes.js +1 -1
  943. package/src/traces/violin/layout_defaults.js +1 -1
  944. package/src/traces/violin/plot.js +1 -1
  945. package/src/traces/violin/style.js +1 -1
  946. package/src/traces/volume/attributes.js +3 -2
  947. package/src/traces/volume/convert.js +13 -13
  948. package/src/traces/volume/defaults.js +1 -1
  949. package/src/traces/volume/index.js +2 -2
  950. package/src/traces/waterfall/attributes.js +1 -1
  951. package/src/traces/waterfall/calc.js +1 -1
  952. package/src/traces/waterfall/constants.js +1 -1
  953. package/src/traces/waterfall/cross_trace_calc.js +1 -1
  954. package/src/traces/waterfall/defaults.js +1 -1
  955. package/src/traces/waterfall/event_data.js +1 -1
  956. package/src/traces/waterfall/hover.js +1 -1
  957. package/src/traces/waterfall/index.js +1 -1
  958. package/src/traces/waterfall/layout_attributes.js +1 -1
  959. package/src/traces/waterfall/layout_defaults.js +1 -1
  960. package/src/traces/waterfall/plot.js +6 -3
  961. package/src/traces/waterfall/style.js +5 -3
  962. package/src/transforms/aggregate.js +1 -1
  963. package/src/transforms/filter.js +1 -1
  964. package/src/transforms/groupby.js +2 -2
  965. package/src/transforms/helpers.js +1 -1
  966. package/src/transforms/sort.js +1 -1
  967. package/tasks/noci_test.sh +1 -1
  968. package/tasks/test_syntax.js +1 -1
  969. package/tasks/util/constants.js +1 -1
  970. package/tasks/util/wrap_locale.js +2 -2
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -33,6 +33,21 @@ module.exports = extendFlat({
33
33
  editType: 'calc',
34
34
  description: 'Sets the color values.'
35
35
  },
36
+ geojson: extendFlat({}, scatterGeoAttrs.geojson, {
37
+ description: [
38
+ 'Sets optional GeoJSON data associated with this trace.',
39
+ 'If not given, the features on the base map are used.',
40
+
41
+ 'It can be set as a valid GeoJSON object or as a URL string.',
42
+ 'Note that we only accept GeoJSONs of type *FeatureCollection* or *Feature*',
43
+ 'with geometries of type *Polygon* or *MultiPolygon*.'
44
+
45
+ // TODO add topojson support with additional 'topojsonobject' attr?
46
+ // https://github.com/topojson/topojson-specification/blob/master/README.md
47
+ ].join(' ')
48
+ }),
49
+ featureidkey: scatterGeoAttrs.featureidkey,
50
+
36
51
  text: extendFlat({}, scatterGeoAttrs.text, {
37
52
  description: 'Sets the text elements associated with each location.'
38
53
  }),
@@ -77,7 +92,8 @@ module.exports = extendFlat({
77
92
  editType: 'calc',
78
93
  flags: ['location', 'z', 'text', 'name']
79
94
  }),
80
- hovertemplate: hovertemplateAttrs()
95
+ hovertemplate: hovertemplateAttrs(),
96
+ showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
81
97
  },
82
98
 
83
99
  colorScaleAttrs('', {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,12 +1,11 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
8
 
9
-
10
9
  'use strict';
11
10
 
12
11
  var Lib = require('../../lib');
@@ -28,7 +27,18 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
28
27
 
29
28
  traceOut._length = Math.min(locations.length, z.length);
30
29
 
31
- coerce('locationmode');
30
+ var geojson = coerce('geojson');
31
+
32
+ var locationmodeDflt;
33
+ if((typeof geojson === 'string' && geojson !== '') || Lib.isPlainObject(geojson)) {
34
+ locationmodeDflt = 'geojson-id';
35
+ }
36
+
37
+ var locationMode = coerce('locationmode', locationmodeDflt);
38
+
39
+ if(locationMode === 'geojson-id') {
40
+ coerce('featureidkey');
41
+ }
32
42
 
33
43
  coerce('text');
34
44
  coerce('hovertext');
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -12,10 +12,12 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) {
12
12
  out.location = pt.location;
13
13
  out.z = pt.z;
14
14
 
15
+ // include feature properties from input geojson
15
16
  var cdi = cd[pointNumber];
16
- if(cdi.fIn) {
17
+ if(cdi.fIn && cdi.fIn.properties) {
17
18
  out.properties = cdi.fIn.properties;
18
19
  }
20
+ out.ct = cdi.ct;
19
21
 
20
22
  return out;
21
23
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -13,6 +13,7 @@ module.exports = {
13
13
  supplyDefaults: require('./defaults'),
14
14
  colorbar: require('../heatmap/colorbar'),
15
15
  calc: require('./calc'),
16
+ calcGeoJSON: require('./plot').calcGeoJSON,
16
17
  plot: require('./plot').plot,
17
18
  style: require('./style').style,
18
19
  styleOnSelect: require('./style').styleOnSelect,
@@ -23,7 +24,7 @@ module.exports = {
23
24
  moduleType: 'trace',
24
25
  name: 'choropleth',
25
26
  basePlotModule: require('../../plots/geo'),
26
- categories: ['geo', 'noOpacity'],
27
+ categories: ['geo', 'noOpacity', 'showLegend'],
27
28
  meta: {
28
29
  description: [
29
30
  'The data that describes the choropleth value-to-color mapping',
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -11,18 +11,15 @@
11
11
  var d3 = require('d3');
12
12
 
13
13
  var Lib = require('../../lib');
14
- var polygon = require('../../lib/polygon');
15
-
14
+ var geoUtils = require('../../lib/geo_location_utils');
16
15
  var getTopojsonFeatures = require('../../lib/topojson_utils').getTopojsonFeatures;
17
- var locationToFeature = require('../../lib/geo_location_utils').locationToFeature;
16
+ var findExtremes = require('../../plots/cartesian/autorange').findExtremes;
17
+
18
18
  var style = require('./style').style;
19
19
 
20
20
  function plot(gd, geo, calcData) {
21
- for(var i = 0; i < calcData.length; i++) {
22
- calcGeoJSON(calcData[i], geo.topojson);
23
- }
24
-
25
21
  var choroplethLayer = geo.layers.backplot.select('.choroplethlayer');
22
+
26
23
  Lib.makeTraceGroups(choroplethLayer, calcData, 'trace choropleth').each(function(calcTrace) {
27
24
  var sel = d3.select(this);
28
25
 
@@ -39,131 +36,51 @@ function plot(gd, geo, calcData) {
39
36
  });
40
37
  }
41
38
 
42
- function calcGeoJSON(calcTrace, topojson) {
39
+ function calcGeoJSON(calcTrace, fullLayout) {
43
40
  var trace = calcTrace[0].trace;
44
- var len = calcTrace.length;
45
- var features = getTopojsonFeatures(trace, topojson);
41
+ var geoLayout = fullLayout[trace.geo];
42
+ var geo = geoLayout._subplot;
43
+ var locationmode = trace.locationmode;
44
+ var len = trace._length;
45
+
46
+ var features = locationmode === 'geojson-id' ?
47
+ geoUtils.extractTraceFeature(calcTrace) :
48
+ getTopojsonFeatures(trace, geo.topojson);
49
+
50
+ var lonArray = [];
51
+ var latArray = [];
46
52
 
47
53
  for(var i = 0; i < len; i++) {
48
54
  var calcPt = calcTrace[i];
49
- var feature = locationToFeature(trace.locationmode, calcPt.loc, features);
50
-
51
- if(!feature) {
55
+ var feature = locationmode === 'geojson-id' ?
56
+ calcPt.fOut :
57
+ geoUtils.locationToFeature(locationmode, calcPt.loc, features);
58
+
59
+ if(feature) {
60
+ calcPt.geojson = feature;
61
+ calcPt.ct = feature.properties.ct;
62
+ calcPt._polygons = geoUtils.feature2polygons(feature);
63
+
64
+ var bboxFeature = geoUtils.computeBbox(feature);
65
+ lonArray.push(bboxFeature[0], bboxFeature[2]);
66
+ latArray.push(bboxFeature[1], bboxFeature[3]);
67
+ } else {
52
68
  calcPt.geojson = null;
53
- continue;
54
69
  }
55
-
56
- calcPt.geojson = feature;
57
- calcPt.ct = feature.properties.ct;
58
- calcPt._polygons = feature2polygons(feature);
59
- }
60
- }
61
-
62
- function feature2polygons(feature) {
63
- var geometry = feature.geometry;
64
- var coords = geometry.coordinates;
65
- var loc = feature.id;
66
-
67
- var polygons = [];
68
- var appendPolygon, j, k, m;
69
-
70
- function doesCrossAntiMerdian(pts) {
71
- for(var l = 0; l < pts.length - 1; l++) {
72
- if(pts[l][0] > 0 && pts[l + 1][0] < 0) return l;
73
- }
74
- return null;
75
- }
76
-
77
- if(loc === 'RUS' || loc === 'FJI') {
78
- // Russia and Fiji have landmasses that cross the antimeridian,
79
- // we need to add +360 to their longitude coordinates, so that
80
- // polygon 'contains' doesn't get confused when crossing the antimeridian.
81
- //
82
- // Note that other countries have polygons on either side of the antimeridian
83
- // (e.g. some Aleutian island for the USA), but those don't confuse
84
- // the 'contains' method; these are skipped here.
85
- appendPolygon = function(_pts) {
86
- var pts;
87
-
88
- if(doesCrossAntiMerdian(_pts) === null) {
89
- pts = _pts;
90
- } else {
91
- pts = new Array(_pts.length);
92
- for(m = 0; m < _pts.length; m++) {
93
- // do nut mutate calcdata[i][j].geojson !!
94
- pts[m] = [
95
- _pts[m][0] < 0 ? _pts[m][0] + 360 : _pts[m][0],
96
- _pts[m][1]
97
- ];
98
- }
99
- }
100
-
101
- polygons.push(polygon.tester(pts));
102
- };
103
- } else if(loc === 'ATA') {
104
- // Antarctica has a landmass that wraps around every longitudes which
105
- // confuses the 'contains' methods.
106
- appendPolygon = function(pts) {
107
- var crossAntiMeridianIndex = doesCrossAntiMerdian(pts);
108
-
109
- // polygon that do not cross anti-meridian need no special handling
110
- if(crossAntiMeridianIndex === null) {
111
- return polygons.push(polygon.tester(pts));
112
- }
113
-
114
- // stitch polygon by adding pt over South Pole,
115
- // so that it covers the projected region covers all latitudes
116
- //
117
- // Note that the algorithm below only works for polygons that
118
- // start and end on longitude -180 (like the ones built by
119
- // https://github.com/etpinard/sane-topojson).
120
- var stitch = new Array(pts.length + 1);
121
- var si = 0;
122
-
123
- for(m = 0; m < pts.length; m++) {
124
- if(m > crossAntiMeridianIndex) {
125
- stitch[si++] = [pts[m][0] + 360, pts[m][1]];
126
- } else if(m === crossAntiMeridianIndex) {
127
- stitch[si++] = pts[m];
128
- stitch[si++] = [pts[m][0], -90];
129
- } else {
130
- stitch[si++] = pts[m];
131
- }
132
- }
133
-
134
- // polygon.tester by default appends pt[0] to the points list,
135
- // we must remove it here, to avoid a jump in longitude from 180 to -180,
136
- // that would confuse the 'contains' method
137
- var tester = polygon.tester(stitch);
138
- tester.pts.pop();
139
- polygons.push(tester);
140
- };
141
- } else {
142
- // otherwise using same array ref is fine
143
- appendPolygon = function(pts) {
144
- polygons.push(polygon.tester(pts));
145
- };
146
70
  }
147
71
 
148
- switch(geometry.type) {
149
- case 'MultiPolygon':
150
- for(j = 0; j < coords.length; j++) {
151
- for(k = 0; k < coords[j].length; k++) {
152
- appendPolygon(coords[j][k]);
153
- }
154
- }
155
- break;
156
- case 'Polygon':
157
- for(j = 0; j < coords.length; j++) {
158
- appendPolygon(coords[j]);
159
- }
160
- break;
72
+ if(geoLayout.fitbounds === 'geojson' && locationmode === 'geojson-id') {
73
+ var bboxGeojson = geoUtils.computeBbox(geoUtils.getTraceGeojson(trace));
74
+ lonArray = [bboxGeojson[0], bboxGeojson[2]];
75
+ latArray = [bboxGeojson[1], bboxGeojson[3]];
161
76
  }
162
77
 
163
- return polygons;
78
+ var opts = {padded: true};
79
+ trace._extremes.lon = findExtremes(geoLayout.lonaxis._ax, lonArray, opts);
80
+ trace._extremes.lat = findExtremes(geoLayout.lataxis._ax, latArray, opts);
164
81
  }
165
82
 
166
83
  module.exports = {
167
- plot: plot,
168
- feature2polygons: feature2polygons
84
+ calcGeoJSON: calcGeoJSON,
85
+ plot: plot
169
86
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -11,7 +11,7 @@
11
11
  var choroplethAttrs = require('../choropleth/attributes');
12
12
  var colorScaleAttrs = require('../../components/colorscale/attributes');
13
13
  var hovertemplateAttrs = require('../../plots/template_attributes').hovertemplateAttrs;
14
-
14
+ var baseAttrs = require('../../plots/attributes');
15
15
  var extendFlat = require('../../lib/extend').extendFlat;
16
16
 
17
17
  module.exports = extendFlat({
@@ -28,9 +28,7 @@ module.exports = extendFlat({
28
28
  // Maybe start with only one value (that we could name e.g. 'geojson-id'),
29
29
  // but eventually:
30
30
  // - we could also support for our own dist/topojson/*
31
- // - some people might want `geojson-properties-name` to map data arrays to
32
- // GeoJSON features
33
- // locationmode: choroplethAttrs.locationmode,
31
+ // .. and locationmode: choroplethAttrs.locationmode,
34
32
 
35
33
  z: {
36
34
  valType: 'data_array',
@@ -47,11 +45,19 @@ module.exports = extendFlat({
47
45
  editType: 'calc',
48
46
  description: [
49
47
  'Sets the GeoJSON data associated with this trace.',
50
- 'Can be set as a valid GeoJSON object or as URL string',
51
- 'Note that we only accept GeoJSON of type *FeatureCollection* and *Feature*',
52
- 'with geometries of type *Polygon* and *MultiPolygon*.'
48
+
49
+ 'It can be set as a valid GeoJSON object or as a URL string.',
50
+ 'Note that we only accept GeoJSONs of type *FeatureCollection* or *Feature*',
51
+ 'with geometries of type *Polygon* or *MultiPolygon*.'
53
52
  ].join(' ')
54
53
  },
54
+ featureidkey: extendFlat({}, choroplethAttrs.featureidkey, {
55
+ description: [
56
+ 'Sets the key in GeoJSON features which is used as id to match the items',
57
+ 'included in the `locations` array.',
58
+ 'Support nested property, for example *properties.name*.'
59
+ ].join(' ')
60
+ }),
55
61
 
56
62
  // TODO agree on name / behaviour
57
63
  //
@@ -103,7 +109,8 @@ module.exports = extendFlat({
103
109
  },
104
110
 
105
111
  hoverinfo: choroplethAttrs.hoverinfo,
106
- hovertemplate: hovertemplateAttrs({}, {keys: ['properties']})
112
+ hovertemplate: hovertemplateAttrs({}, {keys: ['properties']}),
113
+ showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
107
114
  },
108
115
 
109
116
  colorScaleAttrs('', {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -9,15 +9,13 @@
9
9
  'use strict';
10
10
 
11
11
  var isNumeric = require('fast-isnumeric');
12
- var turfArea = require('@turf/area');
13
- var turfCentroid = require('@turf/centroid');
14
12
 
15
13
  var Lib = require('../../lib');
16
14
  var Colorscale = require('../../components/colorscale');
17
15
  var Drawing = require('../../components/drawing');
18
16
 
19
17
  var makeBlank = require('../../lib/geojson_utils').makeBlank;
20
- var feature2polygons = require('../choropleth/plot').feature2polygons;
18
+ var geoUtils = require('../../lib/geo_location_utils');
21
19
 
22
20
  /* N.B.
23
21
  *
@@ -52,25 +50,9 @@ function convert(calcTrace) {
52
50
 
53
51
  if(!isVisible) return opts;
54
52
 
55
- var geojsonIn = typeof trace.geojson === 'string' ?
56
- (window.PlotlyGeoAssets || {})[trace.geojson] :
57
- trace.geojson;
53
+ var features = geoUtils.extractTraceFeature(calcTrace);
58
54
 
59
- // This should not happen, but just in case something goes
60
- // really wrong when fetching the GeoJSON
61
- if(!Lib.isPlainObject(geojsonIn)) {
62
- Lib.error('Oops ... something when wrong when fetching ' + trace.geojson);
63
- return opts;
64
- }
65
-
66
- var lookup = {};
67
- var featuresOut = [];
68
- var i;
69
-
70
- for(i = 0; i < calcTrace.length; i++) {
71
- var cdi = calcTrace[i];
72
- if(cdi.loc) lookup[cdi.loc] = cdi;
73
- }
55
+ if(!features) return opts;
74
56
 
75
57
  var sclFunc = Colorscale.makeColorScaleFuncFromTrace(trace);
76
58
  var marker = trace.marker;
@@ -94,63 +76,19 @@ function convert(calcTrace) {
94
76
  lineWidthFn = function(d) { return d.mlw; };
95
77
  }
96
78
 
97
- function appendFeature(fIn) {
98
- var cdi = lookup[fIn.id];
99
-
100
- if(cdi) {
101
- var geometry = fIn.geometry;
102
-
103
- if(geometry.type === 'Polygon' || geometry.type === 'MultiPolygon') {
104
- var props = {fc: sclFunc(cdi.z)};
105
-
106
- if(opacityFn) props.mo = opacityFn(cdi);
107
- if(lineColorFn) props.mlc = lineColorFn(cdi);
108
- if(lineWidthFn) props.mlw = lineWidthFn(cdi);
109
-
110
- var fOut = {
111
- type: 'Feature',
112
- geometry: geometry,
113
- properties: props
114
- };
115
-
116
- cdi._polygons = feature2polygons(fOut);
117
- cdi.ct = findCentroid(fOut);
118
- cdi.fIn = fIn;
119
- cdi.fOut = fOut;
120
- featuresOut.push(fOut);
121
- } else {
122
- Lib.log([
123
- 'Location with id', cdi.loc, 'does not have a valid GeoJSON geometry,',
124
- 'choroplethmapbox traces only support *Polygon* and *MultiPolygon* geometries.'
125
- ].join(' '));
126
- }
79
+ for(var i = 0; i < calcTrace.length; i++) {
80
+ var cdi = calcTrace[i];
81
+ var fOut = cdi.fOut;
82
+
83
+ if(fOut) {
84
+ var props = fOut.properties;
85
+ props.fc = sclFunc(cdi.z);
86
+ if(opacityFn) props.mo = opacityFn(cdi);
87
+ if(lineColorFn) props.mlc = lineColorFn(cdi);
88
+ if(lineWidthFn) props.mlw = lineWidthFn(cdi);
89
+ cdi.ct = props.ct;
90
+ cdi._polygons = geoUtils.feature2polygons(fOut);
127
91
  }
128
-
129
- // remove key from lookup, so that we can track (if any)
130
- // the locations that did not have a corresponding GeoJSON feature
131
- delete lookup[fIn.id];
132
- }
133
-
134
- switch(geojsonIn.type) {
135
- case 'FeatureCollection':
136
- var featuresIn = geojsonIn.features;
137
- for(i = 0; i < featuresIn.length; i++) {
138
- appendFeature(featuresIn[i]);
139
- }
140
- break;
141
- case 'Feature':
142
- appendFeature(geojsonIn);
143
- break;
144
- default:
145
- Lib.warn([
146
- 'Invalid GeoJSON type', (geojsonIn.type || 'none') + ',',
147
- 'choroplethmapbox traces only support *FeatureCollection* and *Feature* types.'
148
- ].join(' '));
149
- return opts;
150
- }
151
-
152
- for(var loc in lookup) {
153
- Lib.log('Location with id ' + loc + ' does not have a matching feature');
154
92
  }
155
93
 
156
94
  var opacitySetting = opacityFn ?
@@ -175,7 +113,7 @@ function convert(calcTrace) {
175
113
  fill.layout.visibility = 'visible';
176
114
  line.layout.visibility = 'visible';
177
115
 
178
- opts.geojson = {type: 'FeatureCollection', features: featuresOut};
116
+ opts.geojson = {type: 'FeatureCollection', features: features};
179
117
 
180
118
  convertOnSelect(calcTrace);
181
119
 
@@ -210,33 +148,6 @@ function convertOnSelect(calcTrace) {
210
148
  return opts;
211
149
  }
212
150
 
213
- // TODO this find the centroid of the polygon of maxArea
214
- // (just like we currently do for geo choropleth polygons),
215
- // maybe instead it would make more sense to compute the centroid
216
- // of each polygon and consider those on hover/select
217
- function findCentroid(feature) {
218
- var geometry = feature.geometry;
219
- var poly;
220
-
221
- if(geometry.type === 'MultiPolygon') {
222
- var coords = geometry.coordinates;
223
- var maxArea = 0;
224
-
225
- for(var i = 0; i < coords.length; i++) {
226
- var polyi = {type: 'Polygon', coordinates: coords[i]};
227
- var area = turfArea.default(polyi);
228
- if(area > maxArea) {
229
- maxArea = area;
230
- poly = polyi;
231
- }
232
- }
233
- } else {
234
- poly = geometry;
235
- }
236
-
237
- return turfCentroid.default(poly).geometry.coordinates;
238
- }
239
-
240
151
  module.exports = {
241
152
  convert: convert,
242
153
  convertOnSelect: convertOnSelect
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -29,6 +29,8 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
29
29
  return;
30
30
  }
31
31
 
32
+ coerce('featureidkey');
33
+
32
34
  traceOut._length = Math.min(locations.length, z.length);
33
35
 
34
36
  coerce('below');
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -52,7 +52,7 @@ module.exports = {
52
52
  moduleType: 'trace',
53
53
  name: 'choroplethmapbox',
54
54
  basePlotModule: require('../../plots/mapbox'),
55
- categories: ['mapbox', 'gl', 'noOpacity'],
55
+ categories: ['mapbox', 'gl', 'noOpacity', 'showLegend'],
56
56
  meta: {
57
57
  hr_name: 'choropleth_mapbox',
58
58
  description: [
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -166,7 +166,9 @@ var attrs = {
166
166
  editType: 'calc',
167
167
  description: 'Same as `text`.'
168
168
  },
169
- hovertemplate: hovertemplateAttrs({editType: 'calc'}, {keys: ['norm']})
169
+
170
+ hovertemplate: hovertemplateAttrs({editType: 'calc'}, {keys: ['norm']}),
171
+ showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
170
172
  };
171
173
 
172
174
  extendFlat(attrs, colorScaleAttrs('', {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2012-2019, Plotly, Inc.
2
+ * Copyright 2012-2020, Plotly, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
@@ -12,7 +12,7 @@ module.exports = {
12
12
  moduleType: 'trace',
13
13
  name: 'cone',
14
14
  basePlotModule: require('../../plots/gl3d'),
15
- categories: ['gl3d'],
15
+ categories: ['gl3d', 'showLegend'],
16
16
 
17
17
  attributes: require('./attributes'),
18
18
  supplyDefaults: require('./defaults'),