New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arrows using elevation value for any point(x, y) in contour chart #36
Comments
See https://observablehq.com/@grahampullan/gradient-of-a-scalar-field — and https://observablehq.com/@d3/vector-field for an alternative rendering of the arrows. |
Thank you for your reply.
My question is that how to get elevation value for any point (x, y) in
contour chart to define the direction of arrows.
|
I want to know how to get value for point(x,y) when I load data from csv.
- https://observablehq.com/@d3/vector-field
In this example, there is direction property in data array.
- https://observablehq.com/@grahampullan/gradient-of-a-scalar-field
In this example, there is a function to get value for point(x, y) :
function value(x, y) {
...
return out;
}
Thanks again.
|
It would probably depend on the format of your csv. However once you transform it into a linear array values suitable for d3.contour, you can use
|
Edit: I realize you are probably using density contours, not rectangular contours ; so the answer might be more complicated. Please share a notebook on Observable and we'll see how to help you better. |
I want to draw arrows using elevation value in contours like below screenshot.
Please help me on it if anyone can do it.
Thanks so much.
The text was updated successfully, but these errors were encountered: