This tutorial gives a stepwise instruction on how extend a timeseries entry component with a new html-template. This tutorial can be used as a follow up of Integrate a D3 timeseries component.
add scss
support
.angular-cli.json
the parameter defaults.styleExt
from css
to scss
restucture of the view to have two other divs beside the diagram
app.component.html
to app.component.css
to app.component.scss
and adjust it toapp.component.ts
to app.component.scss
install @helgoland/depiction
add HelgolandDatasetlistModule
to import
HelgolandDatasetlistModule
in app.modul.ts
to the import list therefor you need to import it:add SettingsService
to provider
ExtendedSettingsService
which will extend a SettingsService
in your project and add the missing imports (SettingsService
, Settings
of @helgoland/core
and Injectable
of @angular/core
)ExtendedSettingsService
in the list of the providers add n52-timeseries-entry
to app.component.html
(integrate this in the previous created div with the class left
)
add selectDataset
-method to AppComponent
class (handles the selection of a dataset triggered inside the timeseries-entry-component)
add isSelected
-method to AppComponent
class (informs the timeseries-entry-component, if the dataset is selected)
with a ng serve
you should see now the diagram and the listed timeseries entries, by clicking an entry you can highligh it in the diagram
app.module.ts
with MatCardModule
and MatButtonModule
in the import list and import them from @angular/material
styles.scss
ExtendedTimeseriesEntryComponent
- this will generate a component with a basic template an style sheet. The component is also added to the app.module.ts
to the declarations
listextended-timeseries.component.html
to extended-timeseries.component.ts
app-extended-timeseries
to app.component.html
(integrate this in the previous created div with the class right
)updateOptions
-method to AppComponent class (this method is bound with the app-extended-timeseries
component and reacts on dataset option changes)