Comments (18)
It can be fixed very easily:
from react-d3-components.
I also need support for stroke-dasharray
attribute. Preferably, when it is a function, it will be called upon the data and the return value will become the value of stroke-dasharray
attribute.
from react-d3-components.
Yeah I will change that! It's probably a good idea to move some stuff into the style attribute. Thanks for the suggestion.
from react-d3-components.
It will take some days though. If you need it urgently maybe you could send a pullreq, in case you already have an idea of how to implement it.
from react-d3-components.
My hotfix for custom stroke color will raise a warning in browser. Not sure how to suppress that. And there are many other places where you use stroke
as an attribute. I suppose we (you) need to make the same changes to them as well.
I added stroke-dasharray
support for LineChart.
But this is only a specific case of two more general issues:
- Adding support for
stroke-dasharray
attribute for other components as well. - Letting attributes accept functions (data -> attribute_value mappings) as well.
And neither of them seems to be a trivial task.
from react-d3-components.
The graph looks cool :)
Do you mind if, in the future, I include it in the Readme?
But back to topic...
What warning are you getting?
Anyway I agree with both your points and I will think about how to implement them as soon as I can :)
Would be good to have support for all the SVG attributes here: http://facebook.github.io/react/docs/tags-and-attributes.html
from react-d3-components.
I certainly don't mind about the graph but my company probably does :(
The warning is something like "stroke
is a MUST-HAVE attribute you stupid-ass". It is generated by react.js. I switched to production version of react to suppress it along with many other "missing key" warnings.
from react-d3-components.
Ok don't worry, will not use :)
The missing key warnings should be fixed since today 0.4.4.
I will try around with the stroke attribute. A warning is annoying but since we will set it via style maybe we can ignore it.
from react-d3-components.
@felixhao28 I tested the stroke prop (not via style) with rgb(0,0,255) and #0000FF and both worked flawlessly in Chrome, Firefox and Safari.
Did it actually not work for you in some case or you just refer to the webpage in your first post?
I will add the stroke-dasharray prop today :)
from react-d3-components.
Oh I just checked and found my css has been setting the stroke in style. No wonder it does not work!
from react-d3-components.
Hehe ok, thanks for checking.
from react-d3-components.
Thanks for so actively updating this library.
from react-d3-components.
No problem! I would like to do more but work is in the way ;)
BTW are you planning to use animations? If so I would like your feedback soon :)
from react-d3-components.
Not yet. What kind of animation are we talking about?
from react-d3-components.
Like barcharts fading in, growing from bottom to top or a real time chart moving from right to left.
I pushed a test to feature/transition branch, if u want to check out the example.
from react-d3-components.
I added strokeWidth, strokeLinecap and strokeDasharray to LineChart. It's described in the readme under 'customization'. You can supply functions that get passed the label of line.
That is what you needed right? I also uploaded a new version of the example. The one LineChart should show different stroke styles.
from react-d3-components.
Great, exactly what I was hoping for! A big thank you!
from react-d3-components.
As for the animation, I may want to use on LineChart. In my case, user has the option to hide/show a new set of lines and to highlight one set (by changing strokedash-array). If animation effects can be applied to the transitions, I would like to try.
from react-d3-components.
Related Issues (20)
- Feature Suggestion: Having a line when hovering over the chart HOT 1
- Responsive chart HOT 1
- Series colors
- X-axis is not showing in the graph with smaller Y-axis value
- PieChart not rendering HOT 1
- Documentation HOT 1
- Bar Chart Tootlip & tickFormat with image
- dots in tooltip not showing correctlly while hovering HOT 1
- toolTip not working properly on line chart
- Q: Is support react native?
- Is this repo still maintained? HOT 2
- I want to pass xscale value to Bar Chart, how to achieve that!
- PieChart hides label when data is unevenly distributed HOT 4
- Interested to maintain the project HOT 4
- How to customize strokeColor for LineChart? HOT 1
- how to increase column width of barchar and yAix value default like 0 to 100
- How to add stroke color for area chart HOT 1
- NPM vulnerability HOT 1
- 同学,您这个项目引入了615个开源组件,存在27个漏洞,辛苦升级一下
- Integrating D3 into a Vite-TS Project
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 react-d3-components.