Skip to content

Commit a8f62c3

Browse files
Merge pull request #1 from plotly/master
Pull all changes from original plotly to the fork
2 parents 59772c1 + bee2455 commit a8f62c3

File tree

1,768 files changed

+144055
-57359
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,768 files changed

+144055
-57359
lines changed

Diff for: CHANGELOG.md

+191
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,197 @@ https://github.com/plotly/plotly.js/compare/vX.Y.Z...master
99

1010
where X.Y.Z is the semver of most recent plotly.js release.
1111

12+
## [1.54.1] -- 2020-05-04
13+
14+
### Changed
15+
- Update dependencies in package.json & package-lock.json [#4799, #4800, #4802, #4805, #4811]
16+
17+
### Fixed
18+
- Set pointer-events only for editable shapes to allow pan, zoom & hover
19+
events to work inside shapes (regression introduced in 1.54.0) [#4810]
20+
- Update and validate various mocks [#4762]
21+
22+
23+
## [1.54.0] -- 2020-04-30
24+
25+
### Added
26+
- Introduce new drag modes "drawline", "drawrect", "drawcircle", "drawopenpath", "drawclosedpath" &
27+
add optional modebar buttons for drawing & removing new shapes inside cartesian subplots &
28+
add `newshape` and `activeshape` attributes to `layout` &
29+
add `editable` and `fillrule` attributes to `layout.shapes` [#4775]
30+
- Add `angle` and `allowoverlap` attributes to `marker` of `scattermapbox` traces [#4575, #4794]
31+
- Add Portuguese (Portugal) `pt-pt` locale [#4736]
32+
33+
### Changed
34+
- Bump WebGL modules including mapbox-gl and is-mobile [#4731, #4752, #4791]
35+
- Bump jsdom, d3-force, minify-stream, topojson-client and es6-promise [#4751, #4768, #4772, #4773, #4774]
36+
37+
### Fixed
38+
- Sanitize `sourceattribution` in mapbox `layers` [#4793]
39+
- Fix `react`to mapbox `style` changes [#4720]
40+
- Fix transform sort order with gaps [#4783]
41+
- Fix autorange for `bar` and `waterfall` when `base` is present [#4714]
42+
- Fix "extremes" `opacityscale` option for `volume` and `surface` [#4725]
43+
- Fix no-WebGL warning for `scattergl` and `splom` traces [#4777]
44+
- Fix notifier CSS to have a fallback in font stack [#4778]
45+
46+
47+
## [1.53.0] -- 2020-03-31
48+
49+
### Added
50+
- Introduce `rangebreaks` on date axes mainly thanks to [#4614] with API revision & improvements in
51+
[#4639, #4641, #4644, #4649, #4652, #4653, #4660, #4661, #4670, #4677, #4684, #4688, #4695, #4696, #4698, #4699]
52+
- Introduce "(x|y) unified" `hovermode` [#4620, #4664, #4669, #4687]
53+
- Add "hovered data" mode to `spikesnap` [#4665]
54+
- Add "full-json" export format to `Plotly.toImage` and `Plotly.dowloadImage` [#4593]
55+
- Add `node.customdata` and `link.customdata` to `sankey` traces [#4621]
56+
- Add `opacityscale` for `surface` traces [#4480]
57+
58+
### Changed
59+
- Improve `contour` labels (add extra pad) and correct minus sign [#4540]
60+
- Improve sizing text inside `pie` and `sunburst` (add extra pad) [#4519]
61+
- Improve display of spikelines when `spikedistance` is set to -1 [#4637]
62+
- Improve compare `hovermode` to include all points at same coordinate [#4664]
63+
- Improve `histogram` hover labels (harmonize start & end values) [#4662]
64+
- Display new colors on Plotly's logo [#4691]
65+
- Update links & descriptions to Chart Studio Cloud and plotly.com website [#4694]
66+
- Update contributing guidelines & add info about trace module architecture [#4624]
67+
- Require `config.plotlyServerURL` to be set for Chart Studio export [#4690]
68+
69+
### Fixed
70+
- Fix `Plotly.downloadImage` to match transparencies in gl3d plots with the on-screen render [#4566]
71+
- Fix amount of transparency applied by `opacity` in `surface` traces [#4480, #4642]
72+
- Fix gaps in `bar` traces (regression introduced in 1.50.0) [#4634]
73+
- Fix gaps in `funnel` & `waterfall` [#4663]
74+
- Fix `template` to set axis `type`, `tickformatstops`, `tick0`, `dtick`, `tickvals` and `tickmode` [#4670, #4685]
75+
76+
77+
## [1.52.3] -- 2020-03-02
78+
79+
## Fixed
80+
- Make identical bundles on different nodes [#4601]
81+
- Fix (regression introduced in 1.52.1) and improve interactive display of narrow points of `bar`-like traces [#4568]
82+
- Ensure text fits inside `sunburst` sectors with zero values [#4580]
83+
- Reset `splom` selectBatch and unselectBatch on updates [#4595]
84+
- Retry different mobile/tablet config to render gl3d subplots on various devices & browsers e.g. Brave [#4549]
85+
- Bump `is-mobile` to handle iPad Pro & iPad 7th + iOs v13 + Safari [#4548]
86+
- Fix `orthographic` hover after scroll zoom [#4562]
87+
- Preserve gl3d `scene aspectratio` after `orthographic` scroll zoom [#4578]
88+
- Include gl3d `scene.aspectmode` changes in relayout updates [#4579]
89+
- Apply utf-8 charset in test_dashboard [#4554]
90+
91+
92+
## [1.52.2] -- 2020-02-03
93+
94+
## Fixed
95+
- Handle 'missing' matching axes [#4529]
96+
- Fix hover for `mesh3d`, `isosurface` and `volume`
97+
when using `plotGlPixelRatio > 1` (bug introduced in 1.45.0) [#4534]
98+
- Fix hover of `mesh3d` traces with `facecolor` and `intensitymode: 'cell'` [#4539]
99+
- Fix gl3d rendering on iPad Pro & iPad 7th + iOs v13 + Safari [#4360, #4546]
100+
- Fix pixel-rounding logic for blank bars [#4522]
101+
- Fix `pathbar.visible` updates in `treemap` traces [#4516]
102+
- Fix `waterfall` `'closest'` hover when cursor is below the size axis [#4537]
103+
- Fix mapbox layout layer opacity for raster types [#4525]
104+
- Allow `0` in `grouby` transform `nameformat` templates [#4526]
105+
- Fix `Plotly.validate` for `valType:'any'` attributes [#4526]
106+
- Bump `d3-interpolate` to v1.4.0 [#4475]
107+
- Bump `d3-hierarchy` to v1.1.9 [#4475]
108+
- Fix typo in annotation `align` attribute description [#4528]
109+
- Fix `plot_bgcolor` and `paper_bgcolor` attribute description [#4536]
110+
- Fix `insidetextorientation` description for pie and sunburst traces [#4523]
111+
112+
113+
## [1.52.1] -- 2020-01-13
114+
115+
### Fixed
116+
- Fix handling of `geo.visible` false edge case in order to
117+
override `template.layout.geo.show*` attributes [#4483]
118+
119+
120+
## [1.52.0] -- 2020-01-08
121+
122+
### Added
123+
- Add `uniformtext` behavior to `bar`, `funnel`, `waterfall`, `pie`, `funnelarea`,
124+
`sunburst` and `treemap` traces [#4420, #4444, #4469]
125+
- Add "pre-computed" q1/median/q3 input signature for `box` traces [#4432]
126+
- Add support for legend titles [#4386]
127+
- Add legend items for `choropleth`, `choroplethmapbox`, `cone`, `densitymapbox`,
128+
`heatmap`, `histogram2d`, `isosurface`, `mesh3d`, `streamtube`,
129+
`surface`, `volume` traces [#4386, #4441]
130+
- Add "auto-fitting" behavior to geo subplots via `geo.fitbounds` attribute [#4419]
131+
- Add support for custom geojson geometries in `choropleth`
132+
and `scattergeo` traces [#4419]
133+
- Add "exclusive" and "inclusive" quartile-computing algorithm to `box` traces
134+
via `quartilemethod` attribute [#4432]
135+
- Add `insidetextorientation` attribute to `pie` and `sunburst` traces [#4420]
136+
- Add `intensitymode` to allow cell intensity values in `mesh3d` traces [#4446]
137+
- Add `featureidkey` attribute to `choroplethmapbox`, `choropleth`
138+
and `scattergeo` traces [#4419]
139+
- Add `geo.visible` shortcut attribute [#4419]
140+
- Add coordinates of mapbox subplot view as a derived property in `plotly_relayout`
141+
event data [#4413]
142+
- Add modebar buttons `zoomInMapbox` and `zoomOutMapbox` [#4398]
143+
- Add support for typed array in `groupby` transforms `groups` [#4410]
144+
- Add `notifyOnLogging` config option that allows log/warn/error messages
145+
to show up in notifiers pop-ups [#4464]
146+
- Enable loading locale bundles before plotly.js bundles [#4453]
147+
- Add Korean `ko` locale [#4315]
148+
149+
### Changed
150+
- Skip mapbox subplot map position updates while panning/zooming removing
151+
potential stuttering [#4418]
152+
- Optimize mapbox `raster` layout layer updates [#4418]
153+
- Improve `sunburst` and `treemap` click events behavior [#4454]
154+
- Improve attribute description of sunburst/treemap `outsidetextfont` [#4463]
155+
- Update source and dist file headers to 2020 [#4457]
156+
157+
### Fixed
158+
- Fix `streamtube` traces with numeric string coordinates
159+
(bug introduced in 1.51.0) [#4431]
160+
- Correctly handle different data orders in `isosurface` and `volume` traces [#4431]
161+
- Fix symbol numbers in `scattergl` and `splom` traces [#4465]
162+
- Fix `coloraxis` colorbars for `sunburst` and `treemap` with
163+
values colorscales [#4444]
164+
- Fix inside text fitting for `bar`, `funnel` and `waterfall` traces with
165+
set `textangle` [#4444]
166+
- Fix handling of invalid values and zero totals for `pie` and `funnelarea` [#4416]
167+
- Fix colorbar of `reversescale` colorscales of heatmap-coloring contours [#4437]
168+
- Fix colorbar templating for "non-root" colorscales [#4470]
169+
- Fix event data and some hover templates for x/y/z heatmap + contour [#4472]
170+
- Fix "toggleothers" behavior for graphs with traces not in legend [#4406]
171+
- Fix `histogram` bingroup logic when `calendars` module is not registered [#4439]
172+
- Fix "almost equal" `branchvalue: 'total'` partial sum cases [#4442]
173+
- Fix handling of `treemap` `pathbar.textfont` [#4444]
174+
175+
176+
## [1.51.3] -- 2019-12-16
177+
178+
### Fixed
179+
- Fix `Plotly.Plots.resize` edge cases ensuring now that
180+
its promises always resolve [#4392]
181+
- Fix position of link hover labels in vertical `sankey` [#4404]
182+
- Fix `box` autorange for traces with "inverted" notched [#4388]
183+
184+
185+
## [1.51.2] -- 2019-11-25
186+
187+
### Fixed
188+
- Fix `texttemplate`formatting on axes that define
189+
tick prefixes and suffixes [#4380, #4384]
190+
- Fix `cmin` and `cmax` computations during color
191+
value updates on shared color axes [#4366]
192+
- Fix `contour` and `histogram2dcontour` legend item
193+
rendering when `reversescale` is turned on [#4356]
194+
- Fix `contour` and `histogram2dcontour` legend item
195+
rendering when set to a shared color axis [#4356]
196+
- Handle missing `vertexcolor` and `facecolor` during `mesh3d` rendering [#4353]
197+
- No longer coerce `contour` and `colorscale` attributes for `mesh3d`
198+
when not needed [#4346]
199+
- Remove a duplicate function call in `parcoords` code [#4357]
200+
- Include `opacity` in the `surface` trace plot schema [#4344]
201+
- Mention `legend.bgcolor` default in attribute description [#4362]
202+
12203

13204
## [1.51.1] -- 2019-11-04
14205

Diff for: CONTRIBUTING.md

+75-6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ We use the following [labels](https://github.com/plotly/plotly.js/labels) to tra
1717
| `type: bug` | bug report confirmed by a plotly team member |
1818
| `type: regression` | bug that introduced a change in behavior from one version to the next |
1919
| `type: feature` | planned feature additions |
20+
| `type: new trace type` | subset of `type: feature` reserved for planned new trace types |
2021
| `type: translation` | localization-related tasks |
2122
| `type: performance` | performance related tasks |
2223
| `type: maintenance` | source code cleanup resulting in no enhancement for users |
@@ -96,6 +97,13 @@ Three additional helpers exist that are refreshed every second:
9697
There is also a search bar in the top right of the dashboard. This fuzzy-searches
9798
image mocks based on their file name and trace type.
9899

100+
#### Alternative to test dashboard
101+
102+
Use the [`plotly-mock-viewer`](https://github.com/rreusser/plotly-mock-viewer)
103+
which has live-reloading and a bunch of other cool features.
104+
An online version of `plotly-mock-viewer` is available at https://rreusser.github.io/plotly-mock-viewer/
105+
which uses https://cdn.plot.ly/plotly-latest.min.js
106+
99107
#### Other npm scripts
100108

101109
- `npm run preprocess`: pre-processes the css and svg source file in js. This
@@ -175,11 +183,23 @@ which shows the baseline image, the generated image, the diff and the json mocks
175183

176184
To view the results of a run on CircleCI, download the `build/test_images/` and `build/test_images_diff/` artifacts into your local repo and then run `npm run start-image_viewer`.
177185

178-
### Writing interaction tests
186+
### Using the developer console in karma to write/debug jasmine tests
187+
188+
- Click on the `DEBUG` button
189+
- In the `DEBUG RUNNER` window, open the console (e.g. with `<ctrl-shift-j>`)
190+
- Find test file (e.g. with `<ctrl-o>` + typing the name of the file), look out
191+
for "bundled" files with the same name.
192+
- Set `debugger` on relevant line(s)
193+
- Rerun the test suite by refreshing the page (e.g. with `<crtl-r>`)
194+
195+
![Peek 2020-03-11 10-45](https://user-images.githubusercontent.com/6675409/76438118-f2502300-6390-11ea-88d2-17a553c3b4e8.gif)
196+
197+
### Writing jasmine interaction tests
198+
179199
Keep in mind that the interaction coordinates are relative to the top-left corner of the plot, including the margins. To produce a reliable interaction test,
180200
it may be necessary to fix the width, height, margins, X axis range and Y axis range of the plot. For example:
181201

182-
```
202+
```js
183203
Plotly.newPlot(gd, [{
184204
x: [1, 1, 1, 2, 2, 2, 3, 3, 3],
185205
y: [1, 2, 3, 1, 2, 3, 1, 2, 3],
@@ -196,18 +216,67 @@ This will produce the following plot, and say you want to simulate a selection p
196216

197217
<img src="https://user-images.githubusercontent.com/31989842/38890553-0bc6190c-4282-11e8-8efc-077bf05ca565.png">
198218

199-
200219
## Repo organization
201220

202221
- Distributed files are in `dist/`
203222
- CommonJS require-able modules are in `lib/`
204-
- Sources files are in `src/`, including the index
223+
- Sources files are in `src/`
205224
- Build and repo management scripts are in `tasks/`
206225
- All tasks can be run using [`npm run-script`](https://docs.npmjs.com/cli/run-script)
207226
- Tests are `test/`, they are partitioned into `image` and `jasmine` tests
208227
- Test dashboard and image viewer code is in `devtools/`
209-
- Built files are in `build/` (most files in here are git-ignored, the css and font built files are exceptions)
210-
228+
- Built files are in `build/` (the files in here are git-ignored, except for `plotcss.js`)
229+
230+
## Trace module design
231+
232+
The trace modules (found in [`src/traces`](https://github.com/plotly/plotly.js/tree/master/src/traces))
233+
are defined as plain objects with functions and constants attached to them in an index file
234+
(e.g. `src/traces/scatter/index.js`). The trace modules are "registered" undo the `Registry` object
235+
(found in [`src/registry.js`](https://github.com/plotly/plotly.js/blob/master/src/registry.js)) using
236+
`Plotly.register` (as done in the index files in `dist/`).
237+
238+
The trace module methods are meant to be called as part of loops during subplot-specific
239+
(e.g. in `plots/cartesian/index.js`) and figure-wide (e.g. in `plots/plots.js`) subroutines.
240+
That way, the subroutines work no matter which trace modules got registered.
241+
242+
All traces modules set:
243+
244+
- `_module.name`: name of the trace module as used by the trace `type` attribute.
245+
- `_module.basePlotModule`: base plot (or subplot) module corresponding to the
246+
trace type (e.g. `scatter` links to the `Cartesian` base plot module, `scatter3d` links to `gl3d`).
247+
- `_module.attributes`: JSON-serializable object of attribute declarations.
248+
This object is used to generate the plot-schema JSON.
249+
- `_module.supplyDefaults`: Takes in input trace settings and coerces them into "full" settings
250+
under `gd._fullData`. This one is called during the figure-wide `Plots.supplyDefaults` routine.
251+
Note that the `supplyDefaults` method performance should scale with the number of attributes (**not** the
252+
number of data points - so it should not loop over any data arrays).
253+
- `_module.calc`: Converts inputs data into "calculated" (or sanitized) data. This one is called during
254+
the figure-wide `Plots.doCalcdata` routine. The `calc` method is allowed to
255+
scale with the number of data points and is in general more costly than `supplyDefaults`.
256+
Please note that some edit pathways skip `Plots.doCalcdata` (as determined by the
257+
`editType` flags in the attributes files).
258+
- `_module.plot`: Draws the trace on screen. This one is called by the defined `basePlotModule`.
259+
260+
Other methods used by some trace modules:
261+
262+
- `_module.categories`: list of string identifiers used to group traces by behavior. Traces that
263+
have a given category can then be detected using [`Registry.traceIs`](https://github.com/plotly/plotly.js/blob/8f049fddbac0ca0382816984b8526857e9714fe6/src/registry.js#L129-L155)
264+
- `_module.layoutAttributes`: JSON-serializable object of attribute declarations
265+
coerced in the layout (e.g. `barmode` for `bar` traces)
266+
- `_module.supplyLayoutDefaults`: Defaults logic for layout attributes.
267+
- `_module.crossTraceDefaults`: Defaults logic that depends on input setting of multiple traces.
268+
- `_module.crossTraceCalc`: Computations that depend on the data of multiple traces.
269+
- `_module.colorbar`: Defines the colorbar appearance for traces that support it.
270+
- `_module.hoverPoints`: Point-picking logic called during hover.
271+
- `_module.selectPoints`: Polygon-containing logic called during selections.
272+
- `_module.style`: Sometimes split from `_module.plot` where `_module.plot` only
273+
draws the elements and `_module.style` styles them.
274+
- `_module.styleOnSelect`: Optimization of `_module.style` called during
275+
selections.
276+
- `_module.convert`: Sometimes separated from `_module.plot` or `_module.calc` to convert the
277+
plotly.js settings to another framework e.g. to `gl-plot3d` for `gl3d` traces, to
278+
`mapbox-gl` from `mapbox` traces. This split can make the logic easier to test.
279+
If you make a `convert`, you should call it from either `calc` or `plot`.
211280

212281
## Coding style
213282

Diff for: LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2019 Plotly, Inc
3+
Copyright (c) 2020 Plotly, Inc
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)