Skip to content

Commit

Permalink
dataviz: update plotlyjs to v2.35.2 and do custom build to reduce fil…
Browse files Browse the repository at this point in the history
…e size

https://github.com/plotly/plotly.js/blob/master/CUSTOM_BUNDLE.md
`npm run custom-bundle -- --out custom --traces scatter,box,bar,histogram,pie,histogram2d,scatterpolar,sunburst`
  • Loading branch information
nboisteault authored and github-actions[bot] committed Dec 13, 2024
1 parent a7f01c9 commit 3fea435
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 75 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 3fea435

Please sign in to comment.