Commit 93105bdf authored by Mike Bostock's avatar Mike Bostock

Alpha 48.

parent 9f27b1f3
......@@ -38,10 +38,10 @@ D3 3.x was a monolithic library: the core functionality resided in a single [rep
D3 4.0 is modular. Instead of one library, D3 is now [many small libraries](https://github.com/d3) that are designed to work together. You can pick and choose which parts to use as you see fit. Each library is maintained in a separate repository, allowing decentralized ownership and independent release cycles. Want to own a new repository in the [D3 organization](https://github.com/d3)? [Let me know!](https://twitter.com/mbostock)
The [default bundle](https://d3js.org/d3.v4.0.0-alpha.47.js) of D3 4.0 conveniently aggregates [about thirty](https://github.com/d3/d3/blob/master/index.js) of these microlibraries.
The [default bundle](https://d3js.org/d3.v4.0.0-alpha.48.js) of D3 4.0 conveniently aggregates [about thirty](https://github.com/d3/d3/blob/master/index.js) of these microlibraries.
```html
<script src="https://d3js.org/d3.v4.0.0-alpha.47.min.js"></script>
<script src="https://d3js.org/d3.v4.0.0-alpha.48.min.js"></script>
<script>
d3.select("body")
......@@ -70,7 +70,7 @@ Small files are nice, but modularity is also about making D3 *fun* again. Microl
If you don’t care about modularity, you can mostly ignore this change and keep using the default bundle. However, there’s an unavoidable consequence of adopting ES6 modules: every symbol in D3 4.0 now shares a flat namespace rather than the nesting one of D3 3.x. For example, d3.scale.linear is now d3.scaleLinear, and d3.layout.treemap is now d3.treemap. And there have been many other significant improvements to D3’s features! These changes are covered in the sections below. The adoption of ES6 modules also means that D3 is now written exclusively in [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode) and has better readability. (Nearly all of the code from D3 3.x has been rewritten and improved!)
The default D3 [UMD bundle](https://github.com/umdjs/umd) is now anonymous, rather being named “d3”. No `d3` global is exported if AMD or CommonJS is detected. In a vanilla environment, the D3 microlibraries share the `d3` global, meaning the code you write for the default D3 bundle works identically if you load the modules separately. The generated UMD bundles are no longer stored in the Git repository; Bower has been repointed to [d3-bower](https://github.com/mbostock-bower/d3-bower), and you can find the generated files on [npmcdn](https://npmcdn.com/d3@next/) or attached to the [latest release](https://github.com/d3/d3/releases/latest). The non-minified default bundle is no longer mangled, making it more readable and preserving inline comments.
The default D3 [UMD bundle](https://github.com/umdjs/umd) is now anonymous, rather being named “d3”. No `d3` global is exported if AMD or CommonJS is detected. In a vanilla environment, the D3 microlibraries share the `d3` global, meaning the code you write for the default D3 bundle works identically if you load the modules separately. The generated UMD bundles are no longer stored in the Git repository; Bower has been repointed to [d3-bower](https://github.com/mbostock-bower/d3-bower), and you can find the generated files on [npmcdn](https://npmcdn.com/d3@next/) or attached to the [latest release](https://github.com/d3/d3/releases/latest). The non-minified default bundle is no longer mangled, making it more readable and preserving inline comments.
To the consternation of some users, D3 3.x employed Unicode variable names such as τ and π for a concise representation of mathematical operations. A downside of this approach was that a SyntaxError would occur if you loaded the non-minified D3 using ISO-8859-1 instead of UTF-8. D3 3.x also used Unicode string literals, such as the SI-prefix µ for 1e-6. D3 4.0 uses only ASCII variable names and ASCII string literals (see [rollup-plugin-ascii](https://github.com/mbostock/rollup-plugin-ascii)), avoiding these encoding problems.
......@@ -112,7 +112,7 @@ To render axes properly in D3 3.x, you needed to style them:
```html
<style>
.axis path,
.axis line {
fill: none;
......
......@@ -13,7 +13,7 @@ For examples, [see the gallery](https://github.com/d3/d3/wiki/Gallery) and [mbos
The master branch currently contains the prerelease of D3 4.0. The 4.0 API is not yet frozen and may change prior to the release. (For the latest stable release, 3.5.17, follow the [installation instructions](https://github.com/d3/d3/wiki#installing) on the wiki.) If you use NPM, `npm install d3@next`. Otherwise, download the [latest release](https://npmcdn.com/d3@next/build/). The released bundle supports AMD, CommonJS, and vanilla environments. Create a [custom bundle using Rollup](http://bl.ocks.org/mbostock/bb09af4c39c79cffcde4) or your preferred bundler. You can also load directly from [d3js.org](https://d3js.org):
```html
<script src="https://d3js.org/d3.v4.0.0-alpha.47.min.js"></script>
<script src="https://d3js.org/d3.v4.0.0-alpha.48.min.js"></script>
```
For the non-minified version, remove `.min` from the file name.
......
{
"name": "d3",
"version": "4.0.0-alpha.47",
"version": "4.0.0-alpha.48",
"publishConfig": {
"tag": "next"
},
......@@ -43,7 +43,7 @@
"dependencies": {
"d3-array": "0.8.1",
"d3-axis": "0.4.1",
"d3-brush": "0.2.0",
"d3-brush": "0.2.1",
"d3-collection": "0.3.1",
"d3-color": "0.5.0",
"d3-dispatch": "0.5.0",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment