Commit dabb9d5f5f985ef662936f3551835be44a9a4996
1 parent
36fb9368
Exists in
master
and in
2 other branches
Fix the layers' clipping.
Showing
4 changed files
with
12 additions
and
4 deletions
Show diff stats
CHANGELOG.md
web/run.py
... | ... | @@ -22,6 +22,7 @@ from jinja2 import Environment, FileSystemLoader, Markup |
22 | 22 | from netCDF4 import Dataset, date2num |
23 | 23 | from yaml import load as yaml_load |
24 | 24 | |
25 | + | |
25 | 26 | # PATH RELATIVITY ############################################################# |
26 | 27 | |
27 | 28 | THIS_DIRECTORY = dirname(abspath(__file__)) | ... | ... |
web/static/js/swapp.js
... | ... | @@ -559,11 +559,11 @@ |
559 | 559 | this.plotWrapper.attr('transform', 'translate(' + this.margin.left + ',' + this.margin.top + ')'); |
560 | 560 | clipId = "ts-clip-" + this.parameter + "-" + this.target.slug; |
561 | 561 | this.clip = this.svg.append("defs").append("svg:clipPath").attr("id", clipId).append("svg:rect").attr("x", 0).attr("y", 0); |
562 | - this.createCatalogLayers(); | |
563 | 562 | this.pathWrapper = this.plotWrapper.append('g'); |
564 | 563 | this.pathWrapper.attr("clip-path", "url(#" + clipId + ")"); |
565 | 564 | this.path = this.pathWrapper.append('path').datum(this.data).classed('line', true); |
566 | 565 | this.predictiveDataPath = this.pathWrapper.append('path').datum(this.predictiveData).classed('predictive-line', true); |
566 | + this.createCatalogLayers(); | |
567 | 567 | this.horizontalLines = []; |
568 | 568 | if (this.options['horizontalLines']) { |
569 | 569 | for (i$ = 0, len$ = (ref$ = this.options['horizontalLines']).length; i$ < len$; ++i$) { |
... | ... | @@ -749,7 +749,7 @@ |
749 | 749 | }; |
750 | 750 | TimeSeries.prototype.createCatalogLayer = function(started_at, stopped_at){ |
751 | 751 | var layer_rect; |
752 | - layer_rect = this.plotWrapper.append("rect").attr('y', 0).attr('height', this.plotHeight).attr('fill', '#FFFD64C2'); | |
752 | + layer_rect = this.pathWrapper.append("rect").attr('y', 0).attr('height', this.plotHeight).attr('fill', '#FFFD64C2'); | |
753 | 753 | return layer_rect; |
754 | 754 | }; |
755 | 755 | TimeSeries.prototype.resizeCatalogLayers = function(){ | ... | ... |
web/static/js/swapp.ls
... | ... | @@ -446,7 +446,6 @@ export class TimeSeries |
446 | 446 | .attr("x", 0) |
447 | 447 | .attr("y", 0) |
448 | 448 | |
449 | - @createCatalogLayers() | |
450 | 449 | |
451 | 450 | @pathWrapper = @plotWrapper.append('g') |
452 | 451 | @pathWrapper.attr("clip-path", "url(\##{clipId})") |
... | ... | @@ -457,6 +456,8 @@ export class TimeSeries |
457 | 456 | .datum(@predictiveData) |
458 | 457 | .classed('predictive-line', true) |
459 | 458 | |
459 | + @createCatalogLayers() | |
460 | + | |
460 | 461 | @horizontalLines = [] |
461 | 462 | if @options['horizontalLines'] |
462 | 463 | for line in @options['horizontalLines'] |
... | ... | @@ -671,7 +672,7 @@ export class TimeSeries |
671 | 672 | this |
672 | 673 | |
673 | 674 | createCatalogLayer: (started_at, stopped_at) -> |
674 | - layer_rect = @plotWrapper.append("rect") | |
675 | + layer_rect = @pathWrapper.append("rect") | |
675 | 676 | .attr('y', 0) |
676 | 677 | .attr('height', @plotHeight) |
677 | 678 | .attr('fill', '#FFFD64C2') | ... | ... |