Comments (6)
Is this strictly to benefit maintainers of standalone.js? That doesn’t seem particularly onerous at the moment, and it’s nice having some flexibility to support the old monolithic API while designing new CommonJS modules.
(If you’re intending this as a mechanism for creating custom builds, I’m expecting people to either concatenate the pre-built files or to use Browserify to require the non-standalone files directly.)
from d3-selection.
Yes, that makes sense to me. Following my suggestion you would be stuck building the new CommonJS modules to match the old API.
from d3-selection.
OK, closing.
from d3-selection.
Following up on this, I’ve made some changes to how the code is structured. I found it confusing to have two different APIs (one if source files are required directly and another for the “standalone” version). So instead this module now just has one source file, index.js, which populates the d3
object directly. Other D3 modules can follow this same approach of decorating the d3
object.
from d3-selection.
The disadvantage of this approach is being able to require smaller components of d3, which is what I have done in the past with Smash, selecting individual files. This could be done with a require('d3-selection/mouse')
etc. and keep the code size down if the code was separated into individual files in the repo. This isn't necessarily incompatible with the approach of having a single index.js entry point.
However... for the d3-selection module at least there isn't a lot of sense / need to just require a smaller piece, and perhaps the amount of space/kb saves is not that significant?
from d3-selection.
The ability to require smaller components of D3 is one of the main reasons we are breaking D3 up into different repositories. (Imagine d3-selection, d3-transition, d3-scale, etc.) I don’t believe it is worth it to break it down further than the repository / module level.
from d3-selection.
Related Issues (20)
- Using const in size.js breaks IE11 HOT 2
- IE11: SCRIPT5007: Unable to get property 'ownerSVGElement' of undefined or null reference HOT 1
- selection.selectChildren().remove() does not remove all children HOT 1
- How to add passive listener into zoom event? HOT 1
- Proposal: add sample code for transitions into README docs HOT 1
- How to report type issues HOT 1
- d3.style('padding') or d3.style('margin') returned empty string only in firefox HOT 2
- Adopt InternMap for selection.data
- Stash the key used by the previous data-join HOT 2
- Raise an error when passing a `selection.data()` key that does not evaluate to a string. HOT 1
- Selection.one HOT 11
- Please provide your artifact as transpiled (CJS) code. HOT 3
- Enable the use of d3.join() without implicit d3.order() call HOT 3
- selection.appendAll HOT 3
- Is anyone working on D3.ts ? HOT 1
- chaining multiple transform styles to an element do not all get applied to the element HOT 1
- Proposal: Memoization Utility HOT 3
- Error: path attribute d expected number, on value with scientific notation HOT 2
- Chaining select has a side-effect on data HOT 1
- `pointer.js` function is not available for import through `d3-selection` HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-selection.