Skip to content

Commit f725425

Browse files
committed
Merge remote-tracking branch 'upstream/master' into dev/mbx_symbol
2 parents 243680b + eca4b3b commit f725425

File tree

272 files changed

+37089
-11473
lines changed

Some content is hidden

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

272 files changed

+37089
-11473
lines changed

CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,51 @@ https://github.com/plotly/plotly.js/compare/vX.Y.Z...master
1010
where X.Y.Z is the semver of most recent plotly.js release.
1111

1212

13+
## [1.53.0] -- 2020-03-31
14+
15+
### Added
16+
- Introduce `rangebreaks` on date axes mainly thanks to [#4614] with API revision & improvements in
17+
[#4639, #4641, #4644, #4649, #4652, #4653, #4660, #4661, #4670, #4677, #4684, #4688, #4695, #4696, #4698, #4699]
18+
- Introduce "(x|y) unified" `hovermode` [#4620, #4664, #4669, #4687]
19+
- Add "hovered data" mode to `spikesnap` [#4665]
20+
- Add "full-json" export format to `Plotly.toImage` and `Plotly.dowloadImage` [#4593]
21+
- Add `node.customdata` and `link.customdata` to `sankey` traces [#4621]
22+
- Add `opacityscale` for `surface` traces [#4480]
23+
24+
### Changed
25+
- Improve `contour` labels (add extra pad) and correct minus sign [#4540]
26+
- Improve sizing text inside `pie` and `sunburst` (add extra pad) [#4519]
27+
- Improve display of spikelines when `spikedistance` is set to -1 [#4637]
28+
- Improve compare `hovermode` to include all points at same coordinate [#4664]
29+
- Improve `histogram` hover labels (harmonize start & end values) [#4662]
30+
- Display new colors on Plotly's logo [#4691]
31+
- Update links & descriptions to Chart Studio Cloud and plotly.com website [#4694]
32+
- Update contributing guidelines & add info about trace module architecture [#4624]
33+
- Require `config.plotlyServerURL` to be set for Chart Studio export [#4690]
34+
35+
### Fixed
36+
- Fix `Plotly.downloadImage` to match transparencies in gl3d plots with the on-screen render [#4566]
37+
- Fix amount of transparency applied by `opacity` in `surface` traces [#4480, #4642]
38+
- Fix gaps in `bar` traces (regression introduced in 1.50.0) [#4634]
39+
- Fix gaps in `funnel` & `waterfall` [#4663]
40+
- Fix `template` to set axis `type`, `tickformatstops`, `tick0`, `dtick`, `tickvals` and `tickmode` [#4670, #4685]
41+
42+
43+
## [1.52.3] -- 2020-03-02
44+
45+
## Fixed
46+
- Make identical bundles on different nodes [#4601]
47+
- Fix (regression introduced in 1.52.1) and improve interactive display of narrow points of `bar`-like traces [#4568]
48+
- Ensure text fits inside `sunburst` sectors with zero values [#4580]
49+
- Reset `splom` selectBatch and unselectBatch on updates [#4595]
50+
- Retry different mobile/tablet config to render gl3d subplots on various devices & browsers e.g. Brave [#4549]
51+
- Bump `is-mobile` to handle iPad Pro & iPad 7th + iOs v13 + Safari [#4548]
52+
- Fix `orthographic` hover after scroll zoom [#4562]
53+
- Preserve gl3d `scene aspectratio` after `orthographic` scroll zoom [#4578]
54+
- Include gl3d `scene.aspectmode` changes in relayout updates [#4579]
55+
- Apply utf-8 charset in test_dashboard [#4554]
56+
57+
1358
## [1.52.2] -- 2020-02-03
1459

1560
## Fixed

CONTRIBUTING.md

Lines changed: 75 additions & 6 deletions
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

README.md

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
<a href="https://plot.ly/javascript/"><img src="http://images.plot.ly/logo/[email protected]" height="70"></a>
1+
<a href="https://plotly.com/javascript/"><img src="https://images.plot.ly/logo/[email protected]" height="70"></a>
22

33
[![npm version](https://badge.fury.io/js/plotly.js.svg)](https://badge.fury.io/js/plotly.js)
44
[![circle ci](https://circleci.com/gh/plotly/plotly.js.png?&style=shield&circle-token=1f42a03b242bd969756fc3e53ede204af9b507c0)](https://circleci.com/gh/plotly/plotly.js)
55
[![MIT License](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://github.com/plotly/plotly.js/blob/master/LICENSE)
66

7-
Built on top of [d3.js](http://d3js.org/) and [stack.gl](http://stack.gl/),
7+
Built on top of [d3.js](https://d3js.org/) and [stack.gl](http://stack.gl/),
88
plotly.js is a high-level, declarative charting library. plotly.js ships with over 40
99
chart types, including scientific charts, 3D graphs, statistical charts, SVG maps, financial charts,
1010
and more.
1111

1212
<p align="center">
13-
<a href="https://www.plot.ly/javascript" target="_blank">
13+
<a href="https://plotly.com/javascript/" target="_blank">
1414
<img src="https://raw.githubusercontent.com/cldougl/plot_images/add_r_img/plotly_2017.png">
1515
</a></p>
1616

17-
[Contact us](https://plot.ly/products/consulting-and-oem/) for Plotly.js consulting, dashboard development, application integration, and feature additions.
17+
[Contact us](https://plotly.com/products/consulting-and-oem/) for Plotly.js consulting, dashboard development, application integration, and feature additions.
1818

1919
## Table of contents
2020

@@ -44,10 +44,10 @@ and import plotly.js as `import Plotly from 'plotly.js-dist';` or `var Plotly =
4444

4545
```html
4646
<!-- Latest compiled and minified plotly.js JavaScript -->
47-
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
47+
<script src="https://cdn.plot.ly/plotly-latest.min.js" charset="utf-8"></script>
4848

49-
<!-- OR use a specific plotly.js release (e.g. version 1.5.0) -->
50-
<script src="https://cdn.plot.ly/plotly-1.5.0.min.js"></script>
49+
<!-- OR use a specific plotly.js release (e.g. version 1.52.3) -->
50+
<script src="https://cdn.plot.ly/plotly-1.52.3.min.js" charset="utf-8"></script>
5151

5252
<!-- OR an un-minified version is also available -->
5353
<script src="https://cdn.plot.ly/plotly-latest.js" charset="utf-8"></script>
@@ -63,7 +63,7 @@ Fastly supports Plotly.js with free CDN service. Read more at https://www.fastly
6363

6464
and use the plotly.js `dist` file(s). More info [here](https://github.com/plotly/plotly.js/blob/master/dist/README.md).
6565

66-
#### Read the [Getting started page](https://plot.ly/javascript/getting-started/) for more examples.
66+
#### Read the [Getting started page](https://plotly.com/javascript/getting-started/) for more examples.
6767

6868

6969
## Modules
@@ -93,8 +93,6 @@ Then elsewhere in your code:
9393
var Plotly = require('./path/to/custom-plotly');
9494
```
9595

96-
To learn more about the plotly.js module architecture, refer to our [modularizing monolithic JS projects](https://plot.ly/javascript/modularizing-monolithic-javascript-projects/) post.
97-
9896
#### Non-ascii characters
9997

10098
Important: the plotly.js code base contains some non-ascii characters. Therefore, please make sure to set the `charset` attribute to `"utf-8"` in the script tag that imports your plotly.js bundle. For example:
@@ -113,13 +111,11 @@ Have a bug or a feature request? Please first read the [issues guidelines](https
113111

114112
## Documentation
115113

116-
Official plotly.js documentation is hosted on [plot.ly/javascript](https://plot.ly/javascript).
114+
Official plotly.js documentation is hosted on [plotly.com/javascript](https://plotly.com/javascript).
117115

118-
These pages are generated by the Plotly [documentation repo](https://github.com/plotly/documentation/tree/gh-pages) built with [Jekyll](http://jekyllrb.com) and publicly hosted on GitHub Pages.
116+
These pages are generated by the Plotly [graphing-library-docs repo](https://github.com/plotly/graphing-library-docs) built with [Jekyll](https://jekyllrb.com/) and publicly hosted on GitHub Pages.
119117
For more info about contributing to Plotly documentation, please read through [contributing guidelines](https://github.com/plotly/documentation/blob/source/Contributing.md).
120118

121-
You can also suggest new documentation examples by submitting a [Codepen](http://codepen.io/tag/plotly/) on community.plot.ly with tag [`plotly-js`](http://community.plot.ly/c/plotly-js).
122-
123119
## Contributing
124120

125121
Please read through our [contributing guidelines](https://github.com/plotly/plotly.js/blob/master/CONTRIBUTING.md). Included are directions for opening issues, using plotly.js in your project and notes on development.
@@ -128,14 +124,13 @@ Please read through our [contributing guidelines](https://github.com/plotly/plot
128124

129125
* Follow [@plotlygraphs](https://twitter.com/plotlygraphs) on Twitter for the latest Plotly news.
130126
* Follow [@plotly_js](https://twitter.com/plotly_js) on Twitter for plotly.js release updates.
131-
* Implementation help may be found on community.plot.ly (tagged [`plotly-js`](http://community.plot.ly/c/plotly-js)) or
127+
* Implementation help may be found on community.plot.com (tagged [`plotly-js`](https://community.plotly.com/c/plotly-js)) or
132128
on Stack Overflow (tagged [`plotly`](https://stackoverflow.com/questions/tagged/plotly)).
133129
* Developers should use the keyword `plotly` on packages which modify or add to the functionality of plotly.js when distributing through [npm](https://www.npmjs.com/browse/keyword/plotly).
134-
* Direct developer email support can be purchased through a [Plotly Support Plan](https://support.plot.ly/libraries/javascript).
135130

136131
## Versioning
137132

138-
This project is maintained under the [Semantic Versioning guidelines](http://semver.org/).
133+
This project is maintained under the [Semantic Versioning guidelines](https://semver.org/).
139134

140135
See the [Releases section](https://github.com/plotly/plotly.js/releases) of our GitHub project for changelogs for each release version of plotly.js.
141136

@@ -145,15 +140,10 @@ Open-source clients to the plotly.js APIs are available at these links:
145140

146141
| | GitHub repo | Getting started |
147142
|---|--------|---------|
148-
|**R / RStudio**| [ropensci/plotly](https://github.com/ropensci/plotly) | [plot.ly/r/getting-started](https://plot.ly/r/getting-started) |
149-
|**Python / Pandas / IPython notebook**| [plotly/plotly.py](https://github.com/plotly/plotly.py) | [plot.ly/python/getting-started](https://plot.ly/python/getting-started) |
150-
|**MATLAB**| [plotly/matlab-api](https://github.com/plotly/matlab-api) | [plot.ly/matlab/getting-started](https://plot.ly/matlab/getting-started) |
143+
|**R / RStudio**| [ropensci/plotly](https://github.com/ropensci/plotly) | [plotly/r/getting-started](https://plotly.com/r/getting-started) |
144+
|**Python / Pandas / IPython notebook**| [plotly/plotly.py](https://github.com/plotly/plotly.py) | [plotly/python/getting-started](https://plotly.com/python/getting-started) |
145+
|**MATLAB**| [plotly/matlab-api](https://github.com/plotly/matlab-api) | [plotly/matlab/getting-started](https://plotly.com/matlab/getting-started) |
151146
|**node.js / Tonicdev / Jupyter notebook**| [plotly/plotly-notebook-js](https://github.com/plotly/plotly-notebook-js) | |
152-
|**node.js cloud client**| [plotly/plotly-nodejs](https://github.com/plotly/plotly-nodejs) | [plot.ly/nodejs/getting-started](https://plot.ly/nodejs/getting-started) |
153-
|**Julia**| [plotly/Plotly.jl](https://github.com/plotly/Plotly.jl) | [plot.ly/julia/getting-started](https://plot.ly/julia/getting-started) |
154-
155-
plotly.js charts can also be created and saved online for free at [plot.ly/create](https://plot.ly/create).
156-
157147
## Creators
158148

159149
### Active

SECURITY.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ untrusted data being graphed by plotly.js. However, XSS or other issues may sti
99
Note that the typical use case for plotly.js is for visualizing data from trusted sources. For example if you use plotly.js to add a dashboard to your site and you control all the input data that's sent to plotly.js, you are not dependent on plotly.js for XSS protection.
1010

1111
If you require a higher degree of assurance, please consider purchasing our
12-
[Plotly On-Premise](https://plot.ly/product/enterprise/) product, or [contact the Plotly sales team](mailto:sales@plot.ly)
12+
[Plotly On-Premise](https://plotly.com/get-pricing/) product, or [contact the Plotly sales team](mailto:sales@plotly.com)
1313
for more options.
1414

1515
## Reports
1616

17-
To report a security vulnerability, please email security@plot.ly with steps to reproduce the problem. Please allow up to
17+
To report a security vulnerability, please email security@plotly.com with steps to reproduce the problem. Please allow up to
1818
24 hours for an initial response.
1919

2020
## Bounties
2121

22-
In some cases, we offer monetary compensation (bounties) for reports of security vulnerabilities. Please see the [Plotly Security Vulnerability Bounty Program](http://help.plot.ly/security/) page for more information.
22+
In some cases, we offer monetary compensation (bounties) for reports of security vulnerabilities. Please see the [Plotly Security Vulnerability Bounty Program](https://plotly.com/chart-studio-help/security/) page for more information.
2323

2424
## Release Process
2525

@@ -31,4 +31,4 @@ Since the typical plotly.js use case involves trusted data, we do not remove old
3131

3232
## Advisories
3333

34-
All plotly.js security advisories released after August 1, 2016 are available at the [Plotly Security Advisories](http://help.plot.ly/security-advisories/) page.
34+
All plotly.js security advisories released after August 1, 2016 are available at the [Plotly Security Advisories](https://plotly.com/chart-studio-help/security-advisories/) page.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"visualization",
1414
"plotly"
1515
],
16-
"homepage": "https://plot.ly",
16+
"homepage": "https://plotly.com/",
1717
"ignore": [
1818
"**/.*",
1919
"bower_components",

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
"plotly"
1010
],
1111
"minimum-stability": "stable",
12-
"homepage": "https://plot.ly/javascript/",
12+
"homepage": "https://plotly.com/javascript/",
1313
"license": "MIT",
1414
"authors": [
1515
{
1616
"name": "Plotly, Inc.",
17-
"email": "sales@plot.ly"
17+
"email": "sales@plotly.com"
1818
}
1919
]
2020
}

0 commit comments

Comments
 (0)