Comments (2)
Answered first part of the question
:class "dots"
:tag "circle"
:prepare-dataset prepare-dataset
:did-mount
(fn [node ratom]
(let [y-scale (->y-scale ratom)
x-scale (->x-scale ratom)]
(rid3-> node
(.on "mouseover" #(js/alert (gobj/get % "label")))
{:cx (fn [d]
(let [label (gobj/get d "label")]
(x-scale label)))
:cy (fn [d]
(let [value (gobj/get d "value")]
(y-scale value)))
:r 4
:fill "#3366CC"})))}```
from rid3.
@Conaws You are correct that you should use (.on "mouseover" ...) for hover events.
For color of the circles in the scatterplot, here is a very basic example to get you going:
:fill (fn [d]
(let [value (gobj/get d "value")]
(if (> value 15) "blue" "red")))
Depending on how you want to color them, you probably want to reach for d3's built in scales, which can handle colors.
from rid3.
Related Issues (10)
- Idea: interactive doc/article about `rid3` HOT 2
- How to use d3 force simulation? HOT 26
- More lifecycle hooks for top-level components. HOT 3
- feature request: For performance reason, add a path options on the pieces HOT 3
- "d3 is not defined error" when starting out HOT 5
- Pieces should support setting an id HOT 6
- rid3's demo index.html is leaking downstream HOT 1
- Why is the data passed to :elem-with-data required to be in ":dataset" HOT 2
- Use rid3 pie example with cljs advanced code optimizations fails HOT 2
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 rid3.