Skip to content

Commit

Permalink
typescript(vx-demo): ensure number in Treemap sort accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Williams committed Jan 9, 2020
1 parent 00bd039 commit 2e5ee1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vx-demo/src/components/tiles/Treemap.tsx
Expand Up @@ -55,7 +55,7 @@ export default function TreemapDemo({
if (width < 10) return null;

const yMax = height - margin.top - margin.bottom;
const root = hierarchy(data).sort((a, b) => b!.value - a!.value);
const root = hierarchy(data).sort((a, b) => (b.value || 0) - (a.value || 0));

return (
<div>
Expand Down

0 comments on commit 2e5ee1d

Please sign in to comment.