Download pool/shard009/JavaScript/0056306_svg-charts-sub-plot.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 2.36 kB
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard009/JavaScript/0056306_svg-charts-sub-plot.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard009/JavaScript/0056306_svg-charts-sub-plot.js
-
curl -L -o 0056306_svg-charts-sub-plot.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard009/JavaScript/0056306_svg-charts-sub-plot.js
2.36 kB
| ; | |
| /** | |
| * @ngdoc service | |
| * @name svgChartsApp.service:SvgChartsSubPlot | |
| * @description | |
| * # SvgChartsSubPlot | |
| * Factory that contains all the properties and methods for a SvgChartsSubPlot | |
| * | |
| */ | |
| angular.module('svgChartsApp') | |
| .factory('SvgChartsSubPlot', function (SvgChartsScene) { | |
| var SvgChartsSubPlot = {}; | |
| /** | |
| * @ngdoc function | |
| * @name SvgChartsSubPlot.init | |
| * @methodOf svgChartsApp.service:SvgChartsSubPlot | |
| * | |
| * @description | |
| * Public access to the GET, PUT, and POST methods | |
| * | |
| */ | |
| SvgChartsSubPlot.init =function() { | |
| this.subPlotPoints = SvgChartsScene.svgContent.append('g') | |
| .attr('name', 'subPlotPoints'); | |
| }; | |
| /** | |
| * @ngdoc function | |
| * @name SvgChartsSubPlot.cleanUp | |
| * @methodOf svgChartsApp.service:SvgChartsSubPlot | |
| * | |
| * @description | |
| * Public access to the GET, PUT, and POST methods | |
| * | |
| */ | |
| SvgChartsSubPlot.cleanUp =function() { | |
| this.subPlotPoints.selectAll('.subplot-points').remove(); | |
| }; | |
| /** | |
| * @ngdoc function | |
| * @name SvgChartsSubPlot.renderSubPlots | |
| * @methodOf svgChartsApp.service:SvgChartsSubPlot | |
| * | |
| * @description | |
| * Public access to the GET, PUT, and POST methods | |
| * | |
| */ | |
| SvgChartsSubPlot.renderSubPlots = function () { | |
| var subPlots = SvgChartsScene.subPlots; | |
| if(!subPlots) { | |
| subPlots = []; | |
| } | |
| var subPlotCircles = this.subPlotPoints.selectAll('.subplot-points') | |
| .data(subPlots); | |
| subPlotCircles | |
| .enter() | |
| .append('circle') | |
| .attr('style', 'cursor: pointer;') | |
| .attr('class', 'subplot-points') | |
| .on('click', function(d) { | |
| console.log(d); | |
| }); | |
| subPlotCircles.exit().remove(); | |
| subPlotCircles | |
| // .transition() | |
| // .duration(500) | |
| // .ease("linear") | |
| .attr('fill', function (d) { | |
| return d.color || 'black'; | |
| }) | |
| .attr('stroke', function (d) { | |
| return d.strokeColor || '#fff'; | |
| }) | |
| .attr('cx', function(d) { | |
| return SvgChartsScene.x(d.date); | |
| }) | |
| .attr('cy', function (d) { | |
| return SvgChartsScene.y(d.ask); | |
| }) | |
| .attr('r', function(d) { | |
| return d.size || 4; | |
| }); | |
| }; | |
| return SvgChartsSubPlot; | |
| }); | |