Skip to content

Commit

Permalink
Use split utils in Scatterplot
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianmroz-allegro committed Mar 9, 2022
1 parent 0f54f5b commit da2aa82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/client/visualizations/scatterplot/scatterplot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class Scatterplot extends React.Component<ChartProps, ScatterplotState> {

render() {
const { data, essence, stage } = this.props;
const splitKey = essence.splits.splits.first().toKey();
const mainSplit = essence.splits.splits.first();
const showHeatmap = (essence.visualizationSettings as ScatterplotSettings).showSummary;

const {
Expand All @@ -88,7 +88,7 @@ export class Scatterplot extends React.Component<ChartProps, ScatterplotState> {
xSeries={xSeries}
yScale={yScale}
xScale={xScale}
splitKey={splitKey}
split={mainSplit}
timezone={essence.timezone}
showPrevious={essence.hasComparison()}/>
<svg viewBox={stage.getViewBox()}>
Expand Down Expand Up @@ -119,7 +119,7 @@ export class Scatterplot extends React.Component<ChartProps, ScatterplotState> {
{scatterplotData.map(datum => {
return (
<Point
key={`point-${datum[splitKey]}`}
key={`point-${mainSplit.selectValue(datum)}`}
datum={datum}
xScale={xScale}
yScale={yScale}
Expand Down
8 changes: 4 additions & 4 deletions src/client/visualizations/scatterplot/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ import { ConcreteSeries } from "../../../common/models/series/concrete-series";
import "./scatterplot.scss";

import { Timezone } from "chronoshift";
import { Split } from "../../../common/models/split/split";
import { Stage } from "../../../common/models/stage/stage";
import { formatValue } from "../../../common/utils/formatter/formatter";
import { isTruthy } from "../../../common/utils/general/general";
import { SegmentBubbleContent } from "../../components/segment-bubble/segment-bubble";
import { SeriesBubbleContent } from "../../components/series-bubble-content/series-bubble-content";
import { TooltipWithinStage } from "../../components/tooltip-within-stage/tooltip-within-stage";
import { LinearScale } from "../../utils/linear-scale/linear-scale";

interface TooltipProps {
splitKey: string;
split: Split;
datum: Datum;
stage: Stage;
xSeries: ConcreteSeries;
Expand All @@ -50,7 +50,7 @@ export const Tooltip: React.SFC<TooltipProps> = ({
ySeries,
xScale,
yScale,
splitKey,
split,
timezone,
showPrevious
}) => {
Expand All @@ -61,7 +61,7 @@ export const Tooltip: React.SFC<TooltipProps> = ({

return <TooltipWithinStage top={yPosition} left={xPosition} stage={stage}>
<SegmentBubbleContent
title={formatValue(datum[splitKey], timezone)}
title={split.formatValue(datum, timezone)}
content={<>
<strong className="series-title">{xSeries.title()}</strong>
<br/>
Expand Down

0 comments on commit da2aa82

Please sign in to comment.