|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
import { ChartwerkPod, VueChartwerkPodMixin, TimeFormat, yAxisOrientation, CrosshairOrientation } from '@chartwerk/core'; |
|
|
|
|
import { ScatterData, ScatterOptions, PointType, LineType, HighlightedData, MouseMoveEvent } from './types'; |
|
|
|
|
import { ScatterData, ScatterOptions, PointType, LineType, HighlightedData, MouseMoveEvent, DelaunayDataRow } from './types'; |
|
|
|
|
|
|
|
|
|
import { DelaunayDiagram, DelaunayDataRow } from './models/delaunay'; |
|
|
|
|
import { DelaunayDiagram } from './models/delaunay'; |
|
|
|
|
import { ScatterSeries } from './models/scatter_series'; |
|
|
|
|
|
|
|
|
|
import * as d3 from 'd3'; |
|
|
|
@ -123,10 +123,12 @@ export class ChartwerkScatterPod extends ChartwerkPod<ScatterData, ScatterOption
|
|
|
|
|
.filter((d: DelaunayDataRow) => this.series.getSerieByTarget(d[4])?.pointType !== PointType.RECTANGLE) |
|
|
|
|
.attr('class', (d, i: number) => `metric-element metric-circle point-${i}`) |
|
|
|
|
.attr('r', (d: DelaunayDataRow) => this.series.getSerieByTarget(d[4])?.pointSize) |
|
|
|
|
.style('fill', (d: DelaunayDataRow, i: number) => this.getSeriesColorFromDataRow(d, i)) |
|
|
|
|
.style('pointer-events', 'none') |
|
|
|
|
.attr('cx', (d: DelaunayDataRow) => this.state.xScale(d[0])) |
|
|
|
|
.attr('cy', (d: DelaunayDataRow) => this.getYScale(this.series.getSerieByTarget(d[4])?.yOrientation)(d[1])); |
|
|
|
|
.attr('cy', (d: DelaunayDataRow) => this.getYScale(this.series.getSerieByTarget(d[4])?.yOrientation)(d[1])) |
|
|
|
|
.style('fill', (d: DelaunayDataRow, i: number) => this.getSeriesColorFromDataRow(d, i)) |
|
|
|
|
.style('pointer-events', (d: DelaunayDataRow) => this.series.getSerieByTarget(d[4])?.clickCallback ? 'auto' : 'none') |
|
|
|
|
.style('cursor', (d: DelaunayDataRow) => this.series.getSerieByTarget(d[4])?.clickCallback ? 'pointer' : 'crosshair') |
|
|
|
|
.on('click', (d: DelaunayDataRow, idx: number) => this.series.getSerieByTarget(d[4])?.clickCallback(d, idx)); |
|
|
|
|
|
|
|
|
|
this.metricContainer.selectAll(null) |
|
|
|
|
.data(this._delaunayDiagram.data) |
|
|
|
|