From dabb9d5f5f985ef662936f3551835be44a9a4996 Mon Sep 17 00:00:00 2001 From: Goutte Date: Thu, 26 Apr 2018 17:16:54 +0200 Subject: [PATCH] Fix the layers' clipping. --- CHANGELOG.md | 6 ++++++ web/run.py | 1 + web/static/js/swapp.js | 4 ++-- web/static/js/swapp.ls | 5 +++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df85a69..3c0652d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,12 @@ et prendre aussi - [ ] Layer : Auroral Emissions +## 1.3.1 + +- [x] Disable Earth again +- [x] Fix the layers being shown outside the clipping area in the time series + + ## 1.3 - [x] Earth pdyn = pvĀ² (TBD) diff --git a/web/run.py b/web/run.py index 22d0115..3f4623e 100755 --- a/web/run.py +++ b/web/run.py @@ -22,6 +22,7 @@ from jinja2 import Environment, FileSystemLoader, Markup from netCDF4 import Dataset, date2num from yaml import load as yaml_load + # PATH RELATIVITY ############################################################# THIS_DIRECTORY = dirname(abspath(__file__)) diff --git a/web/static/js/swapp.js b/web/static/js/swapp.js index bcddf99..ff8587f 100644 --- a/web/static/js/swapp.js +++ b/web/static/js/swapp.js @@ -559,11 +559,11 @@ this.plotWrapper.attr('transform', 'translate(' + this.margin.left + ',' + this.margin.top + ')'); clipId = "ts-clip-" + this.parameter + "-" + this.target.slug; this.clip = this.svg.append("defs").append("svg:clipPath").attr("id", clipId).append("svg:rect").attr("x", 0).attr("y", 0); - this.createCatalogLayers(); this.pathWrapper = this.plotWrapper.append('g'); this.pathWrapper.attr("clip-path", "url(#" + clipId + ")"); this.path = this.pathWrapper.append('path').datum(this.data).classed('line', true); this.predictiveDataPath = this.pathWrapper.append('path').datum(this.predictiveData).classed('predictive-line', true); + this.createCatalogLayers(); this.horizontalLines = []; if (this.options['horizontalLines']) { for (i$ = 0, len$ = (ref$ = this.options['horizontalLines']).length; i$ < len$; ++i$) { @@ -749,7 +749,7 @@ }; TimeSeries.prototype.createCatalogLayer = function(started_at, stopped_at){ var layer_rect; - layer_rect = this.plotWrapper.append("rect").attr('y', 0).attr('height', this.plotHeight).attr('fill', '#FFFD64C2'); + layer_rect = this.pathWrapper.append("rect").attr('y', 0).attr('height', this.plotHeight).attr('fill', '#FFFD64C2'); return layer_rect; }; TimeSeries.prototype.resizeCatalogLayers = function(){ diff --git a/web/static/js/swapp.ls b/web/static/js/swapp.ls index 2347c43..169b91c 100644 --- a/web/static/js/swapp.ls +++ b/web/static/js/swapp.ls @@ -446,7 +446,6 @@ export class TimeSeries .attr("x", 0) .attr("y", 0) - @createCatalogLayers() @pathWrapper = @plotWrapper.append('g') @pathWrapper.attr("clip-path", "url(\##{clipId})") @@ -457,6 +456,8 @@ export class TimeSeries .datum(@predictiveData) .classed('predictive-line', true) + @createCatalogLayers() + @horizontalLines = [] if @options['horizontalLines'] for line in @options['horizontalLines'] @@ -671,7 +672,7 @@ export class TimeSeries this createCatalogLayer: (started_at, stopped_at) -> - layer_rect = @plotWrapper.append("rect") + layer_rect = @pathWrapper.append("rect") .attr('y', 0) .attr('height', @plotHeight) .attr('fill', '#FFFD64C2') -- libgit2 0.21.2