Skip to content

Commit ea700d1

Browse files
committed
Merge branch 'master' into svg-image-layer
2 parents e1604d4 + f7fee8f commit ea700d1

File tree

108 files changed

+79577
-78354
lines changed

Some content is hidden

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

108 files changed

+79577
-78354
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ build/*
66
!build/ploticon.js
77
!build/README.md
88

9-
npm-debug.log
9+
npm-debug.log*

.npmignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,12 @@ test
99
dist/extras/mathjax
1010

1111
circle.yml
12+
docker-compose.yml
13+
bower.json
14+
15+
.ackrc
16+
.agignore
17+
.eslintignore
18+
.eslintrc
19+
20+
npm-debug.log

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,23 @@ 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.4.0] -- 2016-01-11
13+
## [1.5.0] -- 2016-01-22
14+
15+
### Added
16+
- Modularize the library (first iteration). Trace types can be required in
17+
one-by-one to make custom plotly.js bundles of lesser size. [#180, #187, #193, #202]
18+
19+
### Changed
20+
- Remove json assets from the js source files (to better support Webpack bundling) [#183]
21+
- Update d3, tinycolor2, topojson dependencies [#195]
22+
- Improve `'colorscale'` attribute description [#186]
23+
24+
### Fixed
25+
- Fix pan mode drag delay [#188]
26+
- Make `Plotly.deleteTrace` handle big-indices-array properly [#203]
27+
28+
29+
## [1.4.1] -- 2016-01-11
1430

1531
### Fixed
1632
- Click events work properly after being broken in 1.4.0 [#174]

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,10 @@ To view the results of a run on CircleCI, download the `build/test_images/` and
106106
### Repo organization
107107

108108
- Distributed files are in `dist/`
109+
- CommonJS require-able modules are in `lib/`
109110
- Sources files are in `src/`, including the index
110111
- Build and repo management scripts are in `tasks/`
111-
- All tasks can be run using [`npm run-srcript`](https://docs.npmjs.com/cli/run-script)
112+
- All tasks can be run using [`npm run-script`](https://docs.npmjs.com/cli/run-script)
112113
- Tests are `test/`, they are partitioned into `image` and `jasmine` tests
113114
- Test dashboard and image viewer code is in `devtools/`
114115
- Non-distributed, built files are in `build/` (most files in here are git-ignored, the css and font built files are exceptions)

README.md

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

3-
[![npm version](https://badge.fury.io/js/plotly.js.svg)](https://badge.fury.io/js/plotly.js)
3+
[![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

66
Built on top of [d3.js](http://d3js.org/) and [stack.gl](http://stack.gl/),
@@ -10,6 +10,7 @@ chart types, including 3D charts, statistical graphs, and SVG maps.
1010
## Table of contents
1111

1212
* [Quick start options](#quick-start-options)
13+
* [Modules](#modules)
1314
* [Bugs and feature requests](#bugs-and-feature-requests)
1415
* [Documentation](#documentation)
1516
* [Contributing](#contributing)
@@ -38,9 +39,46 @@ npm install plotly.js
3839
```html
3940
<!-- Latest compiled and minified plotly.js JavaScript -->
4041
<script type="text/javascript" src="https://cdn.plot.ly/plotly-latest.min.js"></script>
42+
43+
<!-- OR use a specific plotly.js release (e.g. version 1.5.0)-->
44+
<script type="text/javascript" src="https://cdn.plot.ly/plotly-1.5.0.min.js"></script>
4145
```
4246

43-
Read the [Getting started page](https://plot.ly/javascript/getting-started/) for examples.
47+
Read the [Getting started page](https://plot.ly/javascript/getting-started/) for more examples.
48+
49+
## Modules
50+
51+
If you would like to reduce the bundle size of plotly.js, you can create a *custom* bundle by using `plotly.js/lib/core`, and loading only the trace types that you need (e.g. `pie` or `choropleth`). The recommended way to do this is by creating a *bundling file*:
52+
53+
```javascript
54+
// in custom-plotly.js
55+
var plotlyCore = require('plotly.js/lib/core');
56+
57+
// Load in the trace types for pie, and choropleth
58+
plotlyCore.register([
59+
require('plotly.js/lib/pie'),
60+
require('plotly.js/lib/choropleth')
61+
]);
62+
63+
module.exports = customPlotly;
64+
```
65+
66+
Then elsewhere in your code:
67+
68+
```javascript
69+
var Plotly = require('./path/to/custom-plotly');
70+
```
71+
72+
**IMPORTANT**: the plotly.js code base contains some non-ascii characters. Therefore, please make sure to set the `chartset` attribute to `"utf-8"` in the script tag that imports your plotly.js bundle. For example:
73+
74+
```html
75+
<script type="text/javascript" src="my-plotly-bundle.js" charset="utf-8"></script>
76+
```
77+
78+
79+
#### Webpack Usage with Modules
80+
81+
Browserify [transforms](https://github.com/substack/browserify-handbook#transforms) are required to build plotly.js, namely, [glslify](https://github.com/stackgl/glslify) to transform WebGL shaders and [cwise](https://github.com/scijs/cwise) to compile component-wise array operations. To make the trace module system work with Webpack, you will need to install [ify-loader](https://github.com/hughsk/ify-loader) and add it to your `webpack.config.json` for your build to correctly bundle plotly.js files.
4482

4583
## Bugs and feature requests
4684

circle.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ test:
2121
override:
2222
- sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' mytestbed)" -- bash -c "cd /var/www/streambed/image_server/plotly.js && node test/image/compare_pixels_test.js"
2323
- npm run citest-jasmine
24+
- npm run test-bundle
2425
- npm run test-syntax
26+
- eslint .

dist/plotly-geo-assets.js

Lines changed: 6 additions & 109 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)