Skip to content

Commit

Permalink
Merge pull request #5127 from 3liz/backport-5126-to-release_3_8
Browse files Browse the repository at this point in the history
[Backport release_3_8] dataviz: update plotlyjs to v2.35.2 and do custom build to reduce file size
  • Loading branch information
nboisteault authored Dec 13, 2024
2 parents b7d0d49 + 9efcf7f commit 13c62ca
Show file tree
Hide file tree
Showing 18 changed files with 41 additions and 98 deletions.
4 changes: 2 additions & 2 deletions lizmap/modules/dataviz/classes/dataviz.listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ public function ongetMapAdditions($event)
if ($dv->getStatus()) {
$locale = substr(jApp::config()->locale, 0, 2);
$js = array(
$bp.'assets/js/dataviz/plotly-latest.min.js',
$bp.'assets/js/dataviz/plotly-custom.min.js',
$bp.'assets/js/dataviz/dataviz.js',
);
if (in_array($locale, array('de', 'el', 'es', 'fr', 'it', 'nl', 'ro'))) {
$js[] = $bp.'assets/js/dataviz/plotly-locale-'.$locale.'-latest.js';
$js[] = $bp.'assets/js/dataviz/plotly-locale-'.$locale.'.js';
}
$datavizConfig = array(
'url' => jUrl::get('dataviz~service:index', array('repository' => $event->repository, 'project' => $event->project)),
Expand Down
4 changes: 2 additions & 2 deletions lizmap/modules/dataviz/controllers/service.classic.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ protected function GetPlot()
$basePath = jApp::config()->urlengine['basePath'];
$locale = substr(jApp::config()->locale, 0, 2);
$plot['plotly'] = array(
'script' => $basePath.'assets/js/dataviz/plotly-latest.min.js',
'locale' => $basePath.'assets/js/dataviz/plotly-locale-'.$locale.'-latest.js',
'script' => $basePath.'assets/js/dataviz/plotly-custom.min.js',
'locale' => $basePath.'assets/js/dataviz/plotly-locale-'.$locale.'.js',
);

$rep->data = $plot;
Expand Down
8 changes: 8 additions & 0 deletions lizmap/www/assets/js/dataviz/plotly-custom.min.js

Large diffs are not rendered by default.

65 changes: 0 additions & 65 deletions lizmap/www/assets/js/dataviz/plotly-latest.min.js

This file was deleted.

1 change: 0 additions & 1 deletion lizmap/www/assets/js/dataviz/plotly-locale-de-latest.js

This file was deleted.

1 change: 1 addition & 0 deletions lizmap/www/assets/js/dataviz/plotly-locale-de.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion lizmap/www/assets/js/dataviz/plotly-locale-es-latest.js

This file was deleted.

1 change: 1 addition & 0 deletions lizmap/www/assets/js/dataviz/plotly-locale-es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion lizmap/www/assets/js/dataviz/plotly-locale-fr-latest.js

This file was deleted.

Loading

0 comments on commit 13c62ca

Please sign in to comment.