-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Angular Plotly localization #184
Comments
Hello @fgiamma . Happy new year ! 😸 Please, note that |
Thanks a lot for your answer @andrefarzat , I am aware of plotly.js-locales but being a newbie in Angular I don't quite understand how to use it. I have configured angular-plotly according to the guide, but I can't figure out how I can load the locale from plotly.js-locales. I tried to load the locale following the guide the example in another topic: `import { NgModule } from '@angular/core'; PlotlyViaCDNModule.setPlotlyVersion('1.58.4'); @NgModule({ private async _setupPlotlyWithDutchLocale() { But I get an error message: Any suggestions on that? |
Create file src/typing.d.ts: declare module 'plotly.js-locales/nl' This is my src/app/app.module.ts: import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {AppComponent} from './app.component';
import * as PlotlyJS from 'plotly.js-dist-min';
import locale from 'plotly.js-locales/ru';
import {PlotlyModule, PlotlyService} from 'angular-plotly.js';
PlotlyModule.plotlyjs = PlotlyJS;
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
PlotlyModule,
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {
constructor(private plotlyService: PlotlyService) {
plotlyService.getPlotly().then(plotly => plotly.register(locale));
}
} And src/typing.d.ts: declare module 'plotly.js-locales/ru' |
Thanks a lot 🙏🙏🙏 |
Hello all,
I am pretty new to Angular, but following the great documentation I managed to have angular Plotly app and running in no time. Everything worked like a charm until I tried to localize Plotly in Italian.
I installed angular-plotly exactly in the way suggested by the documentation:
npm install angular-plotly.js plotly.js-dist-min --save
npm install @types/plotly.js-dist-min --save-dev
Which results in the folders shown in the screenshots attached below, none of which has anything regarding localization.
What am I supposed to do in order to localize plotly? I found some other threads but none of the info there were helpful. I have no folder "lib/locales" and any import suggested obviously fails.
Thanks a lot and have a great new year!
.
The text was updated successfully, but these errors were encountered: