Skip to content

Commit

Permalink
Updated the code to use the built-in fullscreen mode for chart layout…
Browse files Browse the repository at this point in the history
… component
  • Loading branch information
shubhamparikh927 committed Jun 18, 2024
1 parent c197071 commit 2c183e6
Show file tree
Hide file tree
Showing 19 changed files with 27 additions and 159 deletions.
5 changes: 2 additions & 3 deletions apps/documentation/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ChartDemoComponent } from './pages/components/chart/demos/chart/chart-demo.component';

const routes: Routes = [{ path: 'demo', component: ChartDemoComponent }];
const routes: Routes = [];

@NgModule({
imports: [RouterModule.forRoot(routes)],
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class AppRoutingModule {}
7 changes: 0 additions & 7 deletions apps/documentation/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,9 @@ import { HttpClientModule } from '@angular/common/http';
NgDocButtonIconComponent,
FhirChartLegendModule,
HttpClientModule,

RouterModule.forRoot(
[
...NG_DOC_ROUTING,
// this page has a custom child route for the full-screen demo
{
path: 'components/chart-layout',
loadChildren: () => import('./pages/components/chart-layout/demo/chart-layout-demo.component').then((m) => m.ChartLayoutDemoComponent),
},
{
path: '**',
redirectTo: 'introduction',
Expand All @@ -67,7 +61,6 @@ import { HttpClientModule } from '@angular/common/http';
),
],
providers: [
HttpClientModule,
provideNgDocContext(),
provideNgDocApp(),
provideSearchEngine(NgDocDefaultSearchEngine),
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@
align-items: center;
justify-content: center;
}

.full-page-demo {
position: fixed;
top: 0px;
left: 0px;
width: 100vw;
height: 100vh;
z-index: 1000;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<full-page-demo>
<!-- NgDocHTMLSnippetStart(HTML) -->
<!-- NgDocHTMLSnippetStart(HTML) -->
<div class="full-page-demo">
<fhir-chart-layout [toolbar]="['loading', 'patients', 'browser', 'options']">
<div class="example-main-content">Main content</div>
</fhir-chart-layout>
<!-- NgDocHTMLSnippetEnd(HTML) -->
</full-page-demo>
</div>
<!-- NgDocHTMLSnippetEnd(HTML) -->
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { CommonModule } from '@angular/common';
import { Component, OnInit } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import {
DataLayerManagerService,
FhirChartLayoutModule,
} from '@elimuinformatics/ngx-charts-on-fhir';
import { AppRoutingModule } from 'apps/documentation/src/app/app-routing.module';
import { FullPageDemoComponent } from 'apps/documentation/src/app/full-page-demo/full-page-demo.component';

@Component({
selector: 'example-chart-layout-demo',
templateUrl: './chart-layout-demo.component.html',
styleUrls: ['./chart-layout-demo.component.css'],
standalone: true,
imports: [CommonModule, FhirChartLayoutModule, FullPageDemoComponent, AppRoutingModule],
imports: [CommonModule, FhirChartLayoutModule, AppRoutingModule, MatIconModule, MatButtonModule],
providers: [DataLayerManagerService],
})
export class ChartLayoutDemoComponent implements OnInit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,7 @@ A full-page layout with a toolbar and collapsible panels on the left side of the

## Example

{{ NgDocActions.demo("ChartLayoutDemoComponent", { expanded: true, defaultTab: "HTML" }) }}

```ts
// app.module.ts
import { FhirChartLayoutModule } from "@elimuinformatics/ngx-charts-on-fhir";

@NgModule({
imports: [/* ... */ FhirChartLayoutModule],
})
export class AppModule {}
```
{{ NgDocActions.demo("ChartLayoutDemoComponent", {fullscreenRoute: "demo"}) }}

## API Reference

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ const ChartLayout: NgDocPage = {
mdFile: './index.md',
imports: [],
demos: { ChartLayoutDemoComponent },
route: {
children: [
{
path: 'demo',
component: ChartLayoutDemoComponent,
},
],
},
};

export default ChartLayout;
10 changes: 0 additions & 10 deletions apps/documentation/src/app/pages/components/chart-legend/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ Displays the symbol for each tag. Tags are used to apply the same style to multi

{{ NgDocActions.demo("ChartTagsLegendDemoComponent", { expanded: true, defaultTab: "HTML" }) }}

```ts
// app.module.ts
import { FhirChartModule } from "@elimuinformatics/ngx-charts-on-fhir";

@NgModule({
imports: [/* ... */ FhirChartLegendModule],
})
export class AppModule {}
```

## Configuring Tags

The built-in Observation mappers (`SimpleObservationMapper` and `ComponentObservationMapper`) add "Home" and "Clinic" tags.
Expand Down
11 changes: 0 additions & 11 deletions apps/documentation/src/app/pages/components/chart-summary/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@ If the chart and summary are arranged vertically, `autoAlign` should be set to f

{{ NgDocActions.demo("ChartSummaryDemoComponent", { expanded: true, defaultTab: "HTML" }) }}

```ts
// app.module.ts
import { FhirChartModule, FhirChartSummaryModule } from "@elimuinformatics/ngx-charts-on-fhir";

@NgModule({
imports: [/* ... */ FhirChartModule, FhirChartSummaryModule],
providers: [provideChartsOnFhir(withSummaryServices(ScatterDataPointSummaryService))],
})
export class AppModule {}
```

## Summary Services

This component uses the provided `SummaryService` implementations to generate the content for each summary card. It requires at least one `SummaryService` that is capable of summarizing each layer. If more than one service is capable of a summarizing a layer, it will use the one that comes first in the providers array. Charts-on-FHIR comes with a few built-in summary services. Applications can create additional services to customize the summary information or add support for other types of data.
Expand Down
10 changes: 0 additions & 10 deletions apps/documentation/src/app/pages/components/chart/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@ A dynamic chart that displays multiple Data Layers along a single time scale.

{{ NgDocActions.demo("ChartDemoComponent", { expanded: true, defaultTab: "HTML" }) }}

```ts
// app.module.ts
import { FhirChartModule } from "@elimuinformatics/ngx-charts-on-fhir";

@NgModule({
imports: [/* ... */ FhirChartModule],
})
export class AppModule {}
```

### Floating Content

Content can be projected into a draggable floating panel on top of the chart. This can be used to display other Charts-on-FHIR components (like a `*ChartLegend`), or any other custom content.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ A list of all data layers that have been retrieved and are available to add to t

{{ NgDocActions.demo("DataLayerBrowserDemoComponent", { expanded: true, defaultTab: "HTML" }) }}

```ts
// app.module.ts
import { DataLayerBrowserModule } from "@elimuinformatics/ngx-charts-on-fhir";

@NgModule({
imports: [/* ... */ DataLayerBrowserModule],
})
export class AppModule {}
```

## API Reference

- `DataLayerBrowserComponent`
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ A list of all data layers that have been added to the chart. The layers can be r

{{ NgDocActions.demo("DataLayerListDemoComponent", { expanded: true, defaultTab: "HTML" }) }}

```ts
// app.module.ts
import { DataLayerListModule } from "@elimuinformatics/ngx-charts-on-fhir";

@NgModule({
imports: [/* ... */ DataLayerListModule],
})
export class AppModule {}
```

## API Reference

- `DataLayerListComponent`
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ A dropdown menu for switching between pre-defined sets of layers.

{{ NgDocActions.demo("DataLayerSelectorDemoComponent", { expanded: true, defaultTab: "HTML" }) }}

```ts
// app.module.ts
import { FhirChartModule, DataLayerSelectorModule } from "@elimuinformatics/ngx-charts-on-fhir";

@NgModule({
imports: [/* ... */ FhirChartModule, DataLayerSelectorModule],
})
export class AppModule {}
```

## API Reference

- `DataLayerSelectorComponent`
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ A list of all patients that are available on the FHIR server. This can be used d

{{ NgDocActions.demo("PatientBrowserDemoComponent", { expanded: true, defaultTab: "HTML" }) }}

```ts
// app.module.ts
import { PatientBrowserModule } from "@elimuinformatics/ngx-charts-on-fhir";

@NgModule({
imports: [/* ... */ PatientBrowserModule],
})
export class AppModule {}
```

## API Reference

- `PatientBrowserComponent`
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@ A group of buttons for changing the timeframe used for statistical calculations

{{ NgDocActions.demo("SummaryRangeSelectorDemoComponent", { expanded: true, defaultTab: "HTML" }) }}

```ts
// app.module.ts
import {
FhirChartModule,
FhirChartSummaryModule,
SummaryRangeSelectorModule,
} from "@elimuinformatics/ngx-charts-on-fhir";

@NgModule({
imports: [/* ... */ FhirChartModule, FhirChartSummaryModule, SummaryRangeSelectorModule],
})
export class AppModule {}
```

## API Reference

- `SummaryRangeSelectorComponent`
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ A group of buttons and date selectors for adjusting the zoom range of the chart.

{{ NgDocActions.demo("TimelineRangeSelectorDemoComponent", { expanded: true, defaultTab: "HTML" }) }}

```ts
// app.module.ts
import { FhirChartModule, TimelineRangeSelectorModule } from "@elimuinformatics/ngx-charts-on-fhir";

@NgModule({
imports: [/* ... */ FhirChartModule, TimelineRangeSelectorModule],
})
export class AppModule {}
```

## API Reference

- `TimelineRangeSelectorComponent`

0 comments on commit 2c183e6

Please sign in to comment.