Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release_3_9] dataviz: update plotlyjs to v2.35.2 and do custom build to reduce file size #5128

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading