Debian Codegraph @

js/src/Lines.ts

raw
1 /* Copyright 2015 Bloomberg Finance L.P.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 import * as _ from 'underscore';
17 import * as d3 from 'd3';
18 import * as d3Shape from 'd3-shape';
19 // var d3 =Object.assign({}, require("d3-array"), require("d3-selection"), require("d3-shape"), require("d3-transition"));
20 import { Mark } from './Mark';
21 import { LinesModel } from './LinesModel';
22 import { BaseSelector } from './Selector';
23 import { SelectorModel } from './SelectorModel';
24 import * as markers from './Markers';
25
26 const bqSymbol = markers.symbol;
27
28 export class Lines extends Mark {
29 async render() {
30 const baseRenderPromise = super.render();
31 this.dot = bqSymbol().size(this.model.get('marker_size'));
32 if (this.model.get('marker')) {
33 this.dot.type(this.model.get('marker'));
34 }
35
36 // TODO: create_listeners is put inside the promise success handler
37 // because some of the functions depend on child scales being
38 // created. Make sure none of the event handler functions make that
39 // assumption.
40 this.displayed.then(() => {
41 this.parent.tooltip_div.node().appendChild(this.tooltip_div.node());
42 this.create_tooltip();
43 });
44
45 this.display_el_classes = ['line', 'legendtext', 'dot'];
46
47 await baseRenderPromise;
48
49 this.event_listeners = {};
50 this.process_interactions();
51 this.create_listeners();
52 this.compute_view_padding();
53 this.draw(false);
54 }
55
56 set_ranges(): void {
57 const xScale = this.scales.x;
58 if (xScale) {
59 xScale.set_range(this.parent.padded_range('x', xScale.model));
60 }
61 const yScale = this.scales.y;
62 if (yScale) {
63 yScale.set_range(this.parent.padded_range('y', yScale.model));
64 }
65 }
66
67 set_positional_scales(): void {
68 const xScale = this.scales.x,
69 yScale = this.scales.y;
70 this.listenTo(xScale, 'domain_changed', function () {
71 if (!this.model.dirty) {
72 this.update_line_xy();
73 }
74 });
75 this.listenTo(yScale, 'domain_changed', function () {
76 if (!this.model.dirty) {
77 this.update_line_xy();
78 }
79 });
80 }
81
82 initialize_additional_scales(): void {
83 const colorScale = this.scales.color;
84 if (colorScale) {
85 this.listenTo(colorScale, 'domain_changed', function () {
86 this.update_style();
87 });
88 colorScale.on('color_scale_range_changed', this.update_style, this);
89 }
90 }
91
92 create_listeners(): void {
93 super.create_listeners();
94 this.d3el
95 .on(
96 'mouseover',
97 _.bind(() => {
98 this.event_dispatcher('mouse_over');
99 }, this)
100 )
101 .on(
102 'mousemove',
103 _.bind(() => {
104 this.event_dispatcher('mouse_move');
105 }, this)
106 )
107 .on(
108 'mouseout',
109 _.bind(() => {
110 this.event_dispatcher('mouse_out');
111 }, this)
112 );
113
114 this.listenTo(this.model, 'change:tooltip', this.create_tooltip);
115
116 // FIXME: multiple calls to update_path_style. Use on_some_change.
117 this.listenTo(this.model, 'change:interpolation', this.update_path_style);
118 this.listenTo(this.model, 'change:close_path', this.update_path_style);
119
120 // FIXME: multiple calls to update_style. Use on_some_change.
121 this.listenTo(this.model, 'change:colors', this.update_style);
122 this.listenTo(this.model, 'change:opacities', this.update_style);
123 this.listenTo(this.model, 'change:fill_opacities', this.update_style);
124 this.listenTo(this.model, 'change:fill_colors', this.update_style);
125
126 this.listenTo(this.model, 'change:fill', this.update_fill);
127
128 this.listenTo(this.model, 'data_updated', function () {
129 const animate = true;
130 this.draw(animate);
131 });
132 this.listenTo(this.model, 'labels_updated', this.update_labels);
133 this.listenTo(this.model, 'change:stroke_width', this.update_stroke_width);
134 this.listenTo(
135 this.model,
136 'change:labels_visibility',
137 this.update_legend_labels
138 );
139 this.listenTo(
140 this.model,
141 'change:curves_subset',
142 this.update_curves_subset
143 );
144 this.listenTo(this.model, 'change:line_style', this.update_line_style);
145 this.listenTo(this.model, 'change:interactions', this.process_interactions);
146 this.listenTo(this.parent, 'bg_clicked', function () {
147 this.event_dispatcher('parent_clicked');
148 });
149
150 this.listenTo(this.model, 'change:marker', this.update_marker);
151 this.listenTo(this.model, 'change:marker_size', this.update_marker_size);
152 }
153
154 update_legend_labels(): void {
155 if (this.model.get('labels_visibility') === 'none') {
156 this.d3el.selectAll('.legend').attr('display', 'none');
157 this.d3el.selectAll('.curve_label').attr('display', 'none');
158 } else if (this.model.get('labels_visibility') === 'label') {
159 this.d3el.selectAll('.legend').attr('display', 'none');
160 this.d3el.selectAll('.curve_label').attr('display', 'inline');
161 } else {
162 this.d3el.selectAll('.legend').attr('display', 'inline');
163 this.d3el.selectAll('.curve_label').attr('display', 'none');
164 }
165 }
166
167 update_labels(): void {
168 this.d3el
169 .selectAll('.curve')
170 .data(this.model.mark_data)
171 .select('.curve_label')
172 .text((d: any) => {
173 return d.name;
174 });
175 }
176
177 get_line_style(): string {
178 switch (this.model.get('line_style')) {
179 case 'solid':
180 return 'none';
181 case 'dashed':
182 return '10,10';
183 case 'dotted':
184 return '2,10';
185 case 'dash_dotted':
186 return '10,5,2,5';
187 }
188 }
189
190 // Updating the style of the curve, stroke, colors, dashed etc...
191 // Could be fused in a single function for increased readability
192 // and to avoid code repetition
193 update_line_style(): void {
194 this.d3el
195 .selectAll('.curve')
196 .select('.line')
197 .style('stroke-dasharray', _.bind(this.get_line_style, this));
198 if (this.legendEl) {
199 this.legendEl
200 .select('path')
201 .style('stroke-dasharray', _.bind(this.get_line_style, this));
202 }
203 }
204
205 update_stroke_width(model, strokeWidth): void {
206 this.compute_view_padding();
207 this.d3el
208 .selectAll('.curve')
209 .select('.line')
210 .style('stroke-width', strokeWidth);
211 if (this.legendEl) {
212 this.legendEl.select('path').style('stroke-width', strokeWidth);
213 }
214 }
215
216 update_style(): void {
217 const fill = this.model.get('fill'),
218 fillColor = this.model.get('fill_colors'),
219 fillOpacities = this.model.get('fill_opacities');
220 // update curve colors
221 const curves = this.d3el.selectAll('.curve');
222 curves
223 .select('.line')
224 .style('opacity', this.get_mark_opacity.bind(this))
225 .style('stroke', (d, i) => {
226 return this.get_mark_color(d, i) || fillColor[i];
227 })
228 .style('fill', (d, i) => {
229 return fill === 'inside' ? this.get_fill_color(d, i) : '';
230 })
231 .style('fill-opacity', (d, i) => {
232 return fill === 'inside' ? fillOpacities[i] : '';
233 });
234 curves
235 .select('.area')
236 .style('fill', (d, i) => {
237 return this.get_fill_color(d, i);
238 })
239 .style('opacity', (d, i) => {
240 return fillOpacities[i];
241 });
242 this.update_marker_style();
243 // update legend style
244 if (this.legendEl) {
245 this.legendEl
246 .select('.line')
247 .style('stroke', (d, i) => {
248 return this.get_mark_color(d, i) || fillColor[i];
249 })
250 .style('opacity', this.get_mark_opacity.bind(this))
251 .style('fill', (d, i) => {
252 return this.model.get('fill') === 'none'
253 ? ''
254 : this.get_fill_color(d, i);
255 });
256 this.legendEl
257 .select('.dot')
258 .style('stroke', (d, i) => {
259 return this.get_mark_color(d, i) || fillColor[i];
260 })
261 .style('opacity', this.get_mark_opacity.bind(this))
262 .style('fill', (d, i) => {
263 return this.get_mark_color(d, i) || fillColor[i];
264 });
265 this.legendEl
266 .select('text')
267 .style('fill', (d, i) => {
268 return this.get_mark_color(d, i) || fillColor[i];
269 })
270 .style('opacity', this.get_mark_opacity.bind(this));
271 }
272 this.update_stroke_width(this.model, this.model.get('stroke_width'));
273 this.update_line_style();
274 }
275
276 path_closure(): string {
277 return this.model.get('close_path') ? 'Z' : '';
278 }
279
280 update_path_style(): void {
281 const interpolation = this.get_interpolation();
282 this.line.curve(interpolation);
283 this.area.curve(interpolation);
284 this.d3el
285 .selectAll('.curve')
286 .select('.line')
287 .attr('d', (d: any) => {
288 return this.line(d.values) + this.path_closure();
289 });
290 this.d3el
291 .selectAll('.curve')
292 .select('.area')
293 .transition('update_path_style')
294 .duration(0) //FIXME
295 .attr('d', (d: any) => {
296 return this.area(d.values);
297 });
298 if (this.legendEl) {
299 this.legendLine.curve(interpolation);
300 this.legendEl
301 .selectAll('path')
302 .attr('d', this.legendLine(this.legendPathData) + this.path_closure());
303 }
304 }
305
306 relayout(): void {
307 this.set_ranges();
308 this.update_line_xy(false);
309 }
310
311 selector_changed(pointSelector, rectSelector): [] {
312 if (pointSelector === undefined) {
313 this.model.set('selected', null);
314 this.touch();
315 return [];
316 }
317 const pixels = this.pixelCoords;
318 const indices = new Uint32Array(_.range(pixels.length));
319 const selected = indices.filter((index) => {
320 return pointSelector(pixels[index]);
321 });
322 this.model.set('selected', selected);
323 this.touch();
324 }
325
326 invert_point(pixel): void {
327 if (pixel === undefined) {
328 this.model.set('selected', null);
329 this.touch();
330 return;
331 }
332
333 const index = Math.min(
334 this.bisect(this.xPixels, pixel),
335 Math.max(this.xPixels.length - 1, 0)
336 );
337 this.model.set('selected', new Uint32Array([index]));
338 this.touch();
339 }
340
341 update_multi_range(brushExtent): void {
342 const xStart = brushExtent[0];
343 const xEnd = brushExtent[1];
344 const data =
345 this.model.x_data[0] instanceof Array
346 ? this.model.x_data[0]
347 : this.model.x_data;
348 const idXStart = this.bisect(data, xStart);
349 const idXEnd = Math.min(
350 this.bisect(data, xEnd),
351 Math.max(data.length - 1, 0)
352 );
353
354 this.selectorModel.set('selected', [idXStart, idXEnd]);
355 this.selector.touch();
356 }
357
358 draw_legend(elem, xDisp, yDisp, interXDisp, interYDisp: number): number[] {
359 const curveLabels = this.model.get_labels();
360 const legendData = this.model.mark_data.map((d) => {
361 return { index: d.index, name: d.name, color: d.color };
362 });
363 this.legendEl = elem.selectAll('.legend' + this.uuid).data(legendData);
364
365 const rectDim = interYDisp * 0.8,
366 fillColors = this.model.get('fill_colors');
367
368 this.legendLine = d3
369 .line()
370 .curve(this.get_interpolation())
371 .x((d) => {
372 return d[0];
373 })
374 .y((d) => {
375 return d[1];
376 });
377
378 this.legendPathData = [
379 [0, rectDim],
380 [rectDim / 2, 0],
381 [rectDim, rectDim / 2],
382 ];
383
384 const legend = this.legendEl
385 .enter()
386 .append('g')
387 .attr('class', 'legend' + this.uuid)
388 .attr('transform', (d, i) => {
389 return 'translate(0, ' + (i * interYDisp + yDisp) + ')';
390 })
391 .on(
392 'mouseover',
393 _.bind(() => {
394 this.event_dispatcher('legend_mouse_over');
395 }, this)
396 )
397 .on(
398 'mouseout',
399 _.bind(() => {
400 this.event_dispatcher('legend_mouse_out');
401 }, this)
402 )
403 .on(
404 'click',
405 _.bind(() => {
406 this.event_dispatcher('legend_clicked');
407 }, this)
408 );
409
410 legend
411 .append('path')
412 .attr('class', 'line')
413 .attr('fill', 'none')
414 .attr('d', this.legendLine(this.legendPathData) + this.path_closure())
415 .style('stroke', (d, i) => {
416 return this.get_mark_color(d, i) || fillColors[i];
417 })
418 .style('fill', (d, i) => {
419 return this.model.get('fill') === 'none'
420 ? ''
421 : this.get_fill_color(d, i);
422 })
423 .style('opacity', this.get_mark_opacity.bind(this))
424 .style('stroke-width', this.model.get('stroke_width'))
425 .style('stroke-dasharray', _.bind(this.get_line_style, this));
426
427 if (this.model.get('marker')) {
428 legend
429 .append('path')
430 .attr('class', 'dot')
431 .attr('transform', 'translate(' + rectDim / 2 + ',0)')
432 .attr('d', this.dot.size(25))
433 .style('fill', (d, i) => {
434 return this.get_mark_color(d, i);
435 });
436 }
437
438 legend
439 .append('text')
440 .attr('class', 'legendtext')
441 .attr('x', rectDim * 1.2)
442 .attr('y', rectDim / 2)
443 .attr('dy', '0.35em')
444 .text((d, i) => {
445 return curveLabels[i];
446 })
447 .style('fill', (d, i) => {
448 return this.get_mark_color(d, i) || fillColors[i];
449 })
450 .style('opacity', this.get_mark_opacity.bind(this));
451
452 this.legendEl = legend.merge(this.legendEl);
453
454 const maxLength = d3.max(curveLabels, (d: any) => {
455 return d.length;
456 });
457 this.legendEl.exit().remove();
458 return [this.model.mark_data.length, maxLength];
459 }
460
461 update_curves_subset(): void {
462 const displayLabels = this.model.get('labels_visibility') === 'label';
463 // Show a subset of the curves
464 const curvesSubset = this.model.get('curves_subset');
465 if (curvesSubset.length > 0) {
466 this.d3el
467 .selectAll('.curve')
468 .attr('display', (d, i) => {
469 return curvesSubset.indexOf(i) !== -1 ? 'inline' : 'none';
470 })
471 .select('.curve_label')
472 .attr('display', (d, i) => {
473 return curvesSubset.indexOf(i) !== -1 && displayLabels
474 ? 'inline'
475 : 'none';
476 });
477 if (this.legendEl) {
478 this.legendEl.attr('display', (d, i) => {
479 return curvesSubset.indexOf(i) !== -1 ? 'inline' : 'none';
480 });
481 }
482 this.d3el.selectAll('.curve');
483 } else {
484 //make all curves visible
485 this.d3el
486 .selectAll('.curve')
487 .attr('display', 'inline')
488 .select('.curve_label')
489 .attr('display', (d) => {
490 return displayLabels ? 'inline' : 'none';
491 });
492 if (this.legendEl) {
493 this.legendEl.attr('display', 'inline');
494 }
495 }
496 }
497
498 update_fill(): void {
499 const fill = this.model.get('fill'),
500 area = fill === 'top' || fill === 'bottom' || fill === 'between';
501
502 const yScale = this.scales.y;
503
504 this.area.defined((d: any) => {
505 return area && d.y !== null && isFinite(yScale.scale(d.y));
506 });
507
508 if (fill == 'bottom') {
509 this.area.y0(this.parent.plotarea_height);
510 } else if (fill == 'top') {
511 this.area.y0(0);
512 } else if (fill == 'between') {
513 this.area.y0((d: any) => {
514 return yScale.scale(d.y0) + yScale.offset;
515 });
516 }
517 this.d3el
518 .selectAll('.curve')
519 .select('.area')
520 .attr('d', (d: any) => {
521 return this.area(d.values);
522 });
523 this.d3el
524 .selectAll('.curve')
525 .select('.line')
526 .style('fill', (d, i) => {
527 return fill === 'inside' ? this.get_fill_color(d, i) : '';
528 });
529 // update legend fill
530 if (this.legendEl) {
531 this.legendEl.select('path').style('fill', (d, i) => {
532 return fill === 'none' ? '' : this.get_fill_color(d, i);
533 });
534 }
535 }
536
537 get_fill_color(data, index): string {
538 const fillColors: string = this.model.get('fill_colors');
539 return fillColors.length === 0
540 ? this.get_mark_color(data, index)
541 : fillColors[index];
542 }
543
544 update_line_xy(animate): void {
545 const xScale = this.scales.x,
546 yScale = this.scales.y;
547 const animationDuration =
548 animate === true ? this.parent.model.get('animation_duration') : 0;
549
550 this.line
551 .x((d: any) => {
552 return xScale.scale(d.x) + xScale.offset;
553 })
554 .y((d: any) => {
555 return yScale.scale(d.y) + yScale.offset;
556 });
557
558 const fill = this.model.get('fill');
559 this.area
560 .x((d: any) => {
561 return xScale.scale(d.x) + xScale.offset;
562 })
563 .y1((d: any) => {
564 return yScale.scale(d.y) + yScale.offset;
565 });
566
567 if (fill == 'bottom') {
568 this.area.y0(this.parent.plotarea_height);
569 } else if (fill == 'top') {
570 this.area.y0(0);
571 } else if (fill == 'between') {
572 this.area.y0((d: any) => {
573 return yScale.scale(d.y0) + yScale.offset;
574 });
575 }
576
577 const curvesSel = this.d3el.selectAll('.curve');
578
579 curvesSel
580 .select('.line')
581 .transition('update_line_xy')
582 .attr('d', (d: any) => {
583 return this.line(d.values) + this.path_closure();
584 })
585 .duration(animationDuration);
586
587 curvesSel
588 .select('.area')
589 .transition('update_line_xy')
590 .attr('d', (d: any, i) => {
591 return this.area(d.values);
592 })
593 .duration(animationDuration);
594
595 curvesSel
596 .select('.curve_label')
597 .transition('update_line_xy')
598 .attr('transform', (d: any) => {
599 const lastXy = d.values[d.values.length - 1];
600 return (
601 'translate(' +
602 xScale.scale(lastXy.x) +
603 ',' +
604 yScale.scale(lastXy.y) +
605 ')'
606 );
607 })
608 .duration(animationDuration);
609
610 this.update_dots_xy(animate);
611 this.xPixels =
612 this.model.mark_data.length > 0
613 ? this.model.mark_data[0].values.map((el) => {
614 return xScale.scale(el.x) + xScale.offset;
615 })
616 : [];
617 this.yPixels =
618 this.model.mark_data.length > 0
619 ? this.model.mark_data[0].values.map((el) => {
620 return yScale.scale(el.y) + yScale.offset;
621 })
622 : [];
623 this.pixelCoords =
624 this.model.mark_data.length > 0
625 ? this.model.mark_data[0].values.map((el) => {
626 return [
627 xScale.scale(el.x) + xScale.offset,
628 yScale.scale(el.y) + yScale.offset,
629 ];
630 })
631 : [];
632 }
633
634 get_interpolation():
635 | d3Shape.CurveFactory
636 | d3Shape.CurveFactory
637 | d3Shape.CurveFactory
638 | d3Shape.CurveFactory {
639 const curveTypes = {
640 linear: d3.curveLinear,
641 basis: d3.curveBasis,
642 cardinal: d3.curveCardinal,
643 monotone: d3.curveMonotoneY,
644 };
645
646 return curveTypes[this.model.get('interpolation')];
647 }
648
649 draw(animate): void {
650 this.set_ranges();
651 const curvesSel = this.d3el.selectAll('.curve').data(this.model.mark_data);
652
653 const yScale = this.scales.y;
654
655 const newCurves = curvesSel.enter().append('g').attr('class', 'curve');
656 newCurves
657 .append('path')
658 .attr('class', 'line')
659 .attr('fill', 'none')
660 .attr('id', (d, i) => 'curve' + (i + 1))
661 .on('click', () => {
662 this.event_dispatcher('element_clicked');
663 });
664 newCurves.append('path').attr('class', 'area');
665 newCurves
666 .append('text')
667 .attr('class', 'curve_label')
668 .attr('x', 3)
669 .attr('dy', '.35em')
670 .attr(
671 'display',
672 this.model.get('labels_visibility') !== 'label' ? 'none' : 'inline'
673 )
674 .text((d: any) => d.name);
675
676 const fill = this.model.get('fill'),
677 area = fill === 'top' || fill === 'bottom' || fill === 'between';
678
679 this.draw_dots();
680
681 this.line = d3
682 .line()
683 .curve(this.get_interpolation())
684 .defined((d: any) => {
685 return d.y !== null && isFinite(yScale.scale(d.y));
686 });
687
688 this.area = d3
689 .area()
690 .curve(this.get_interpolation())
691 .defined((d: any) => {
692 return area && d.y !== null && isFinite(yScale.scale(d.y));
693 });
694
695 // Having a transition on exit is complicated. Please refer to
696 // Scatter.js for detailed explanation.
697 curvesSel.exit().remove();
698 this.update_line_xy(animate);
699 this.update_style();
700
701 // alter the display only if a few of the curves are visible
702 this.update_curves_subset();
703 }
704
705 draw_dots(): void {
706 if (this.model.get('marker')) {
707 const dots = this.d3el
708 .selectAll('.curve')
709 .selectAll('.dot')
710 .data((d: any, i) => {
711 return d.values.map((e) => {
712 return { x: e.x, y: e.y, sub_index: e.sub_index };
713 });
714 });
715 dots.enter().append('path').attr('class', 'dot');
716 dots.exit().remove();
717 }
718 }
719
720 update_dots_xy(animate): void {
721 if (this.model.get('marker')) {
722 const xScale = this.scales.x,
723 yScale = this.scales.y;
724 const animationDuration =
725 animate === true ? this.parent.model.get('animation_duration') : 0;
726 const dots = this.d3el.selectAll('.curve').selectAll('.dot');
727
728 dots
729 .transition('update_dots_xy')
730 .duration(animationDuration)
731 .attr('transform', (d: any) => {
732 return (
733 'translate(' +
734 (xScale.scale(d.x) + xScale.offset) +
735 ',' +
736 (yScale.scale(d.y) + yScale.offset) +
737 ')'
738 );
739 })
740 .attr(
741 'd',
742 this.dot
743 .size(this.model.get('marker_size'))
744 .type(this.model.get('marker'))
745 );
746 }
747 }
748
749 compute_view_padding(): void {
750 //This function sets the padding for the view through the variables
751 //xPadding and yPadding which are view specific paddings in pixel
752 let xPadding;
753 if (this.model.get('marker')) {
754 const markerPadding = Math.sqrt(this.model.get('marker_size')) / 2 + 1.0;
755 const linePadding = this.model.get('stroke_width') / 2.0;
756 xPadding = Math.max(markerPadding, linePadding);
757 } else {
758 xPadding = this.model.get('stroke_width') / 2.0;
759 }
760
761 const yPadding = xPadding;
762 if (xPadding !== this.xPadding || yPadding !== this.yPadding) {
763 this.xPadding = xPadding;
764 this.yPadding = yPadding;
765 this.trigger('mark_padding_updated');
766 }
767 }
768
769 update_marker_style() {
770 const that = this;
771 const fillColor = this.model.get('fill_colors');
772 const opacities = this.model.get('opacities');
773 this.d3el.selectAll('.curve').each(function (d, i) {
774 const curve = d3.select(this);
775 curve
776 .selectAll('.dot')
777 .style('opacity', opacities[i])
778 .style('fill', that.get_mark_color(d, i) || fillColor[i]);
779 });
780 }
781
782 update_marker(model, marker): void {
783 if (marker) {
784 this.draw_dots();
785 this.update_dots_xy(false);
786 this.update_marker_style();
787 if (this.legendEl) {
788 this.legendEl.select('.dot').attr('d', this.dot.type(marker).size(25));
789 }
790 } else {
791 this.d3el.selectAll('.dot').remove();
792 if (this.legendEl) {
793 this.legendEl.select('.dot').attr('d', this.dot.size(0));
794 }
795 }
796 }
797
798 update_marker_size(model, markerSize): void {
799 this.compute_view_padding();
800 this.d3el.selectAll('.dot').attr('d', this.dot.size(markerSize));
801 }
802
803 clear_style(style_dict, indices?) {}
804
805 set_default_style(indices) {}
806
807 set_style_on_elements(style, indices) {}
808
809 dot: any;
810 legendEl: d3.Selection<any, any, any, any>;
811 legendLine: d3.Line<[number, number]>;
812 legendPathData: [number, number][];
813 selector: BaseSelector;
814 selectorModel: SelectorModel;
815 area: d3.Area<[number, number]>;
816 line: d3.Line<[number, number]>;
817 xPixels: number[];
818 yPixels: number[];
819 pixelCoords: number[];
820
821 // Overriding super class
822 model: LinesModel;
823 }