Skip to content

Commit

Permalink
fix(scatterplot): fix scatterplot voronoi overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Benitte authored and Raphaël Benitte committed Apr 17, 2019
1 parent 4b0bcb9 commit 3bdc783
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/scatterplot/src/ScatterPlot.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class ScatterPlot extends Component {
layerById.mesh = (
<Mesh
key="mesh"
points={points}
nodes={points}
width={width}
height={height}
onMouseEnter={onMouseEnter}
Expand Down
2 changes: 1 addition & 1 deletion packages/scatterplot/src/enhance.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const enhanceCanvas = Component =>
withPropsOnChange(
['points', 'width', 'height', 'debugMesh'],
({ points, width, height, debugMesh }) => {
const points2d = computeMeshPoints({ points }).points
const points2d = computeMeshPoints({ points })

return computeMesh({ points: points2d, width, height, debug: debugMesh })
}
Expand Down
2 changes: 1 addition & 1 deletion packages/swarmplot/src/SwarmPlot.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ const SwarmPlot = memo(
if (typeof layer === 'function') {
return <Fragment key={i}>{layer(layerContext)}</Fragment>
}

return null
})}
</SvgWrapper>
Expand Down
4 changes: 2 additions & 2 deletions packages/voronoi/src/meshCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const renderVoronoiToCanvas = (ctx, voronoi) => {
ctx.beginPath()
voronoi.render(ctx)
ctx.strokeStyle = 'red'
ctx.lineWidth = 0.5
ctx.lineWidth = 1
ctx.stroke()

ctx.restore()
Expand All @@ -23,7 +23,7 @@ export const renderVoronoiToCanvas = (ctx, voronoi) => {
export const renderVoronoiCellToCanvas = (ctx, voronoi, index) => {
ctx.save()

ctx.globalAlpha = 0.25
ctx.globalAlpha = 0.35
ctx.beginPath()
voronoi.renderCell(index, ctx)
ctx.fillStyle = 'red'
Expand Down
1 change: 1 addition & 0 deletions website/src/pages/scatterplot/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ const ScatterPlotCanvas = () => {
label: `[point] serie: ${node.serie.id}, x: ${node.x}, y: ${
node.y
}`,
color: node.color,
data: node,
})
}}
Expand Down
5 changes: 3 additions & 2 deletions website/src/pages/scatterplot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ const initialProperties = {
motionDamping: 15,

isInteractive: true,
useMesh: true,
debugMesh: true,
useMesh: false,
debugMesh: false,

'custom tooltip example': false,
tooltip: null,
Expand Down Expand Up @@ -145,6 +145,7 @@ const ScatterPlot = () => {
label: `[point] serie: ${node.serie.id}, x: ${node.x}, y: ${
node.y
}`,
color: node.color,
data: node,
})
}}
Expand Down

0 comments on commit 3bdc783

Please sign in to comment.