Skip to content

Commit

Permalink
noi-techpark#5 update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxXx1313 committed Feb 9, 2025
1 parent dcc4b41 commit 107b042
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 43 deletions.
6 changes: 2 additions & 4 deletions src/blocks/backdrop/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@ SPDX-License-Identifier: CC0-1.0

### Used by

- [noi-road-webcam](../../road-webcam)
- [noi-traffic-prediction](../../traffic-prediction)
- [noi-brennerlec](../../road-webcam)

### Graph
```mermaid
graph TD;
noi-road-webcam --> noi-backdrop
noi-traffic-prediction --> noi-backdrop
noi-brennerlec --> noi-backdrop
style noi-backdrop fill:#f9f,stroke:#333,stroke-width:4px
```

Expand Down
6 changes: 2 additions & 4 deletions src/blocks/button/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,14 @@ SPDX-License-Identifier: CC0-1.0

### Used by

- [noi-brennerlec](../../road-webcam)
- [noi-input](../input)
- [noi-road-webcam](../../road-webcam)
- [noi-traffic-prediction](../../traffic-prediction)

### Graph
```mermaid
graph TD;
noi-brennerlec --> noi-button
noi-input --> noi-button
noi-road-webcam --> noi-button
noi-traffic-prediction --> noi-button
style noi-button fill:#f9f,stroke:#333,stroke-width:4px
```

Expand Down
6 changes: 2 additions & 4 deletions src/blocks/icon/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,16 @@ Icon size can be changed by 'font-size' style

### Used by

- [noi-brennerlec](../../road-webcam)
- [noi-input](../input)
- [noi-road-webcam](../../road-webcam)
- [noi-road-webcam-list](../../road-webcam/partials/road-webcam-list)
- [noi-traffic-prediction](../../traffic-prediction)

### Graph
```mermaid
graph TD;
noi-brennerlec --> noi-icon
noi-input --> noi-icon
noi-road-webcam --> noi-icon
noi-road-webcam-list --> noi-icon
noi-traffic-prediction --> noi-icon
style noi-icon fill:#f9f,stroke:#333,stroke-width:4px
```

Expand Down
4 changes: 2 additions & 2 deletions src/blocks/map/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ SPDX-License-Identifier: CC0-1.0

### Used by

- [noi-road-webcam](../../road-webcam)
- [noi-brennerlec](../../road-webcam)

### Graph
```mermaid
graph TD;
noi-road-webcam --> noi-brennerlec-map
noi-brennerlec --> noi-brennerlec-map
style noi-brennerlec-map fill:#f9f,stroke:#333,stroke-width:4px
```

Expand Down
25 changes: 25 additions & 0 deletions src/components.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2025 NOI Techpark <[email protected]>
//
// SPDX-License-Identifier: AGPL-3.0-or-later

/* eslint-disable */
/* tslint:disable */
/**
Expand All @@ -24,6 +28,9 @@ export namespace Components {
*/
"hidden": boolean;
}
/**
* Road webcameras component
*/
interface NoiBrennerlec {
/**
* Language
Expand All @@ -33,7 +40,13 @@ export namespace Components {
* Layout appearance
*/
"layout": ViewLayout;
/**
* Reload camera data (basically, it's images)
*/
"refreshData": () => Promise<void>;
/**
* Data reload interval
*/
"reloadInterval": number;
}
/**
Expand Down Expand Up @@ -127,6 +140,9 @@ declare global {
prototype: HTMLNoiBackdropElement;
new (): HTMLNoiBackdropElement;
};
/**
* Road webcameras component
*/
interface HTMLNoiBrennerlecElement extends Components.NoiBrennerlec, HTMLStencilElement {
}
var HTMLNoiBrennerlecElement: {
Expand Down Expand Up @@ -250,6 +266,9 @@ declare namespace LocalJSX {
*/
"onBackdropClick"?: (event: NoiBackdropCustomEvent<void>) => void;
}
/**
* Road webcameras component
*/
interface NoiBrennerlec {
/**
* Language
Expand All @@ -259,6 +278,9 @@ declare namespace LocalJSX {
* Layout appearance
*/
"layout"?: ViewLayout;
/**
* Data reload interval
*/
"reloadInterval"?: number;
}
/**
Expand Down Expand Up @@ -341,6 +363,9 @@ declare module "@stencil/core" {
* (INTERNAL) Backdrop component.
*/
"noi-backdrop": LocalJSX.NoiBackdrop & JSXBase.HTMLAttributes<HTMLNoiBackdropElement>;
/**
* Road webcameras component
*/
"noi-brennerlec": LocalJSX.NoiBrennerlec & JSXBase.HTMLAttributes<HTMLNoiBrennerlecElement>;
/**
* (INTERNAL) render leaflet map
Expand Down
4 changes: 2 additions & 2 deletions src/data/webcam/webcam-data-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import { getAssetPath } from "../../utils/asset-path";
* Default interval to reload data
* 1 minute
*/
const RELOAD_INTERVAL_DEFAULT = 60 * 1000;
export const RELOAD_INTERVAL_DEFAULT = 60 * 1000;
/**
* Minimum interval to reload data
* 10 seconds
*/
const RELOAD_INTERVAL_MIN = 10 * 1000;
export const RELOAD_INTERVAL_MIN = 10 * 1000;

// origin is used to track usage and traffic patterns
const ORIGIN = 'webcomp-brennerlec';
Expand Down
15 changes: 14 additions & 1 deletion src/road-webcam/brennerlec.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ import { WebcamInfoShort } from "../data/webcam/WebcamInfoShort";
import { Subscription } from "../utils/TimerWatcher";
import { LanguageDataService } from "../data/language/language-data-service";

/**
* Road webcameras component
*
* @part list - camera list
* @part map - Map
* @part popup - Popup dialog
*/
@Component({
tag: 'noi-brennerlec',
styleUrl: 'brennerlec.css',
Expand All @@ -30,8 +37,11 @@ export class BrennerlecComponent implements StencilComponent {
@Prop({mutable: true})
layout: ViewLayout = 'auto';

/**
* Data reload interval
*/
@Prop({mutable: true})
reloadInterval: number;
reloadInterval: number = 60000;

@State()
layoutResolved: ViewLayout;
Expand Down Expand Up @@ -90,6 +100,9 @@ export class BrennerlecComponent implements StencilComponent {
this.refreshData();
}

/**
* Reload camera data (basically, it's images)
*/
@Method()
async refreshData() {
// re-subscribe to data source
Expand Down
6 changes: 3 additions & 3 deletions src/road-webcam/partials/road-webcam-list/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SPDX-License-Identifier: CC0-1.0

## Overview

(INTERNAL) part of 'noi-road-webcam'
(INTERNAL) part of 'noi-brennerlec'

## Properties

Expand All @@ -35,7 +35,7 @@ SPDX-License-Identifier: CC0-1.0

### Used by

- [noi-road-webcam](../..)
- [noi-brennerlec](../..)

### Depends on

Expand All @@ -49,7 +49,7 @@ graph TD;
noi-road-webcam-list --> noi-input
noi-input --> noi-icon
noi-input --> noi-button
noi-road-webcam --> noi-road-webcam-list
noi-brennerlec --> noi-road-webcam-list
style noi-road-webcam-list fill:#f9f,stroke:#333,stroke-width:4px
```

Expand Down
67 changes: 44 additions & 23 deletions src/road-webcam/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,54 @@ SPDX-License-Identifier: CC0-1.0
<!-- Auto Generated Below -->


## Overview

Road webcameras component

## Properties

| Property | Attribute | Description | Type | Default |
| ---------- | ---------- | ----------- | --------------------------------------------- | -------- |
| `language` | `language` | | `string` | `'en'` |
| `layout` | `layout` | | `"auto" \| "desktop" \| "mobile" \| "tablet"` | `'auto'` |
| Property | Attribute | Description | Type | Default |
| ---------------- | ----------------- | -------------------- | --------------------------------------------- | -------- |
| `language` | `language` | Language | `string` | `'en'` |
| `layout` | `layout` | Layout appearance | `"auto" \| "desktop" \| "mobile" \| "tablet"` | `'auto'` |
| `reloadInterval` | `reload-interval` | Data reload interval | `number` | `60000` |


## Methods

### `refreshData() => Promise<void>`

Reload camera data (basically, it's images)

#### Returns

Type: `Promise<void>`




## Shadow Parts

| Part | Description |
| --------- | ----------- |
| `"list"` | |
| `"map"` | |
| `"popup"` | |
| Part | Description |
| --------- | ------------ |
| `"list"` | camera list |
| `"map"` | Map |
| `"popup"` | Popup dialog |


## CSS Custom Properties

| Name | Description |
| --------------------- | --------------------------- |
| `--color-background` | Background color |
| `--color-marker` | Map marker color |
| `--color-primary` | Primary color |
| `--color-primary-rgb` | Primary color in RGB format |
| `--color-secondary` | Secondary color |
| `--color-text` | Text color |
| Name | Description |
| ----------------------- | --------------------------- |
| `--color-background` | Background color |
| `--color-primary` | Primary color |
| `--color-primary-rgb` | Primary color in RGB format |
| `--color-secondary` | Secondary color |
| `--color-text` | Text color |
| `--map-marker-color` | Map marker color |
| `--map-marker-color-bg` | Map marker background |
| `--scrollbar-bg` | Scrollbar background color |
| `--scrollbar-color` | Scrollbar thumb color |


## Dependencies
Expand All @@ -53,16 +74,16 @@ SPDX-License-Identifier: CC0-1.0
### Graph
```mermaid
graph TD;
noi-road-webcam --> noi-road-webcam-list
noi-road-webcam --> noi-brennerlec-map
noi-road-webcam --> noi-backdrop
noi-road-webcam --> noi-button
noi-road-webcam --> noi-icon
noi-brennerlec --> noi-road-webcam-list
noi-brennerlec --> noi-brennerlec-map
noi-brennerlec --> noi-backdrop
noi-brennerlec --> noi-button
noi-brennerlec --> noi-icon
noi-road-webcam-list --> noi-icon
noi-road-webcam-list --> noi-input
noi-input --> noi-icon
noi-input --> noi-button
style noi-road-webcam fill:#f9f,stroke:#333,stroke-width:4px
style noi-brennerlec fill:#f9f,stroke:#333,stroke-width:4px
```

----------------------------------------------
Expand Down

0 comments on commit 107b042

Please sign in to comment.