Skip to content

Commit

Permalink
removing resizeobserver again
Browse files Browse the repository at this point in the history
  • Loading branch information
mlisnic committed Feb 22, 2024
1 parent 85afffd commit 7297686
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/public/viz-guardrails/LineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
/* eslint-disable camelcase */
/* eslint-disable @typescript-eslint/no-explicit-any */

// import { useResizeObserver } from '@mantine/hooks';
import { useMemo, useState } from 'react';
import * as d3 from 'd3';
import { Center, Text } from '@mantine/core';
Expand Down
6 changes: 3 additions & 3 deletions src/public/viz-guardrails/StripPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import { from, escape } from 'arquero';
import { useMemo } from 'react';
import * as d3 from 'd3';
import { useResizeObserver } from '@mantine/hooks';
import { ChartParams } from './DataExplorer';

const margin = {
Expand All @@ -23,7 +22,8 @@ export function StripPlot({
selection: string[];
parameters: ChartParams
}) {
const [ref, { width, height }] = useResizeObserver();
const width = 60;
const height = 400;

const allData = useMemo(() => {
const tempData = data.map((d: any) => ({ ...d, value: +d[parameters.y_var] }));
Expand All @@ -40,7 +40,7 @@ export function StripPlot({
const textFormat = parameters.dataset === 'clean_stocks' ? d3.format('.0%') : d3.format(',.0f');

return selection?.length === 0 ? null : (
<svg ref={ref} style={{ height: '400px', width: '60px', overflow: 'visible' }}>
<svg style={{ height: '400px', width: '60px', overflow: 'visible' }}>
{/* <YAxis yScale={yScale} horizontalPosition={275} xRange={[0, 0]}/> */}
{/* <line x1={margin.left} x2={margin.left} y1={margin.top} y2={height - margin.bottom} strokeWidth={1} stroke={'black'}></line> */}
<rect y={yScale(selectedDataRange[1])} height={yScale(selectedDataRange[0]) - yScale(selectedDataRange[1])} x={margin.left - 10} width={10} opacity={0.1} fill="black" />
Expand Down

0 comments on commit 7297686

Please sign in to comment.