Download pool/shard007/JavaScript/0044142_PointLayer.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 1.59 kB
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard007/JavaScript/0044142_PointLayer.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard007/JavaScript/0044142_PointLayer.js
-
curl -L -o 0044142_PointLayer.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard007/JavaScript/0044142_PointLayer.js
1.59 kB
| define(['LayerBase'], function(LayerBase) { | |
| PointLayer = function(options) { | |
| if(options)this.init(options); | |
| }; | |
| PointLayer.prototype = new LayerBase(); | |
| PointLayer.prototype.prep = function() { | |
| this.config.data = this.plot.data(); | |
| this.config.dur = this.plot.duration(); | |
| this.config.delay = this.plot.delay(); | |
| this.config.scales = this.plot.scales(); | |
| this.config.attrs = this.CompileAttrs(this.config.attrs); | |
| this.config.elements.forEach(function(elem){ | |
| elem.type = elem.type || 'circle'; | |
| elem.initAttrs = { | |
| class:elem.type+"-"+this.config.kind, | |
| opacity: 1e-6 | |
| }; | |
| if(elem.type == 'circle') elem.initAttrs.r = this.plot.radius.min(); | |
| }, this); | |
| }; | |
| PointLayer.prototype.update = function() { | |
| var c = this.config; | |
| c.elements.forEach(function(e){ | |
| var attrs = this.CompileAttrs(e.attrs), | |
| elem; | |
| if(e.static) initAttrs = {}; | |
| c.group | |
| .selectAll(e.type+".enter") | |
| .classed('enter',false) | |
| .attr(attrs) | |
| .attr(e.initAttrs) | |
| .text((e.type == 'text'? e.text : null) ); | |
| elem = c.group.selectAll(e.type); | |
| elem | |
| .interrupt() | |
| .transition() | |
| .delay(c.delay) | |
| .duration(c.dur) | |
| .attr("opacity", 1) | |
| .attr(attrs); | |
| c.layerElem | |
| .selectAll( c.groupType+"."+c.name+"-item.exit") | |
| .selectAll(e.type) | |
| .interrupt() | |
| .transition() | |
| .duration(c.dur) | |
| .attr(e.initAttrs) | |
| .remove(); | |
| }, this); | |
| }; | |
| return PointLayer; | |
| }); | |