Skip to content

Commit

Permalink
Remove hardcoded fields
Browse files Browse the repository at this point in the history
Signed-off-by: Kipruto <[email protected]>
  • Loading branch information
kelvinkipruto committed Aug 12, 2024
1 parent 6d19c74 commit 2dd4254
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions packages/hurumap-core/src/Scope/HeatMapScope.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ export default function HeatMapScope(props) {
name: "selectedStripeTemp",
value: 0,
on: [
{ events: "@stripe:pointerover", update: "datum.count" },
{
events: "@stripe:pointerover",
update: {
signal: "datatype[Units]",
},
},
{ events: "@stripe:pointerout", update: "0" },
],
},
Expand All @@ -78,15 +83,22 @@ export default function HeatMapScope(props) {
type: "linear",
domain: {
data: "primary",
field: "count",
field: {
signal: "datatype[Units]",
},
},
range: [theme.palette.primary.main, theme.palette.primary.light],
range: [theme.palette.secondary.main, theme.palette.primary.main],
reverse: true,
},
{
name: "scaleYForLegendTick",
type: "linear",
domain: { data: "primary", field: "count" },
domain: {
data: "primary",
field: {
signal: "datatype[Units]",
},
},
range: [0, { signal: "height" }],
zero: false,
reverse: true,
Expand All @@ -108,7 +120,9 @@ export default function HeatMapScope(props) {
},
fill: {
scale: "color",
field: "count",
field: {
signal: "datatype[Units]",
},
},
// TODO: check why tooltip is not working correctly
// tooltip: [
Expand Down

0 comments on commit 2dd4254

Please sign in to comment.