Comments (5)
In the end there was nothing wrong with my set of webpack rules. I had to attach the d3 plugins to the d3 library like
const d3 = Object.assign(d3Base, { legendColor, lineChunked })
I followed the suggestion described in the following article:
https://www.giacomodebidda.com/how-to-import-d3-plugins-with-webpack/
Problem solved.
from d3-legend.
d3-svg-legend
should be including its own set of d3 versions as dependencies, maybe I'm missing something, do you have more details? Can you give me some more information? how did you include d3v5 in your project? Are both installed via a package.json
?
from d3-legend.
Hi Susielu,
My webpack contains:
"dependencies": { "d3": "^5.9.2", "d3-scale-chromatic": "^1.3.3", "d3-svg-legend": "^2.25.6", "vue-bootstrap-typeahead": "^0.2.6", "vue-router": "^3.0.6", "vuex": "^3.1.0" }
I am importing d3 and d3-svg-legend in a vue component as I do (succesfully) with other modules as well.
The components are bundled in a app.js by using webpack.
In webpack there are some rules regarding svg in file names, eg.
rules.push({ // only include svg that doesn't have font in the path or file name by using negative lookahead test: /(\.(png|jpe?g|gif|webp)$|^((?!font).)*\.svg$)/, loaders: [{ blablabla } ] })
and
// Add support for loading fonts. rules.push({ test: /(\.(woff2?|ttf|eot|otf)$|font.*\.svg$)/, loader: 'file-loader'})
My regex test on "d3-svg-legend" suggests no conflicts with the defined rules, but I might be wrong: as well on my regex conclusion or on my suggestion regarding a fault triggered by webpack. I hope you can help me a bit.
regards,
ppeer
from d3-legend.
I'm not well versed in regex, but there was another person that posted this solution for an exclusion, they make sure the dot is in front of all of the options, so it only looks at .svg
file extentions: #79
from d3-legend.
Ahhh excellent, thanks for posting the solution!
from d3-legend.
Related Issues (20)
- label color remains black in dark mode
- Last threshold's "more than x" label should be "x or more" HOT 2
- Library is not included in webpack bundle HOT 9
- ENH: labelFormat to support numeraljs format HOT 1
- NS_ERROR_FAILURE errors HOT 15
- help wanted: irregular patch legend HOT 5
- Custom Color and Shape? HOT 2
- legend size defaults to 5 when data has length of 1 HOT 2
- Feature Request: Vertical legend text alignment options HOT 6
- cellclick and "#tag"+d.key.replace(/\s+/g, '') HOT 4
- Support for d3.scaleTime() HOT 2
- legend with clamp values HOT 1
- Scrollable Legend HOT 1
- Property 'labelWrap' does not exist on type 'LegendColor' HOT 1
- Legend not showing up properly if hidden using jQuery
- Interface LegendColor, issues with cellFilter method, argument type is missing
- labelWrap only wraps white space
- .on functions don't work with d3 v6 HOT 2
- please upgrade to d3 v6 HOT 1
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-legend.