stockchart-treemap 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +89 -90
  3. package/package.json +1 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 stockchart-treemap contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,90 +1,89 @@
1
- # stockchart-treemap
2
-
3
- Готовый к публикации на npm пакет с самостоятельным TreeMap-компонентом для Angular.
4
- Компонент работает как standalone, поддерживает подсветку по `TreeMapColorScale`,
5
- источники данных в виде массива, Observable или лоадера, а также кастомные шаблоны плиток и заголовков.
6
-
7
- ## Сборка и публикация
8
- 1. Соберите библиотеку:
9
- ```bash
10
- npm run ng -- build stockchart-treemap
11
- ```
12
- 2. Перейдите в папку сборки и опубликуйте пакет (убедитесь, что вошли в npm):
13
- ```bash
14
- cd dist/stockchart-treemap
15
- npm publish --access public
16
- ```
17
-
18
- ## Сборка примерных компонентов для отладки
19
- Для локального тестирования и пошаговой отладки демо-компонентов соберите отдельный пакет `stockchart-treemap-examples`:
20
- ```bash
21
- npm run build:stockchart-treemap-examples
22
- ```
23
- Сборка использует tsconfig для примеров и кладёт артефакты в `dist/stockchart-treemap-examples`, чтобы их можно было подключить в песочнице или во внешнем приложении без вмешательства в основной пакет.
24
-
25
- Для живого просмотра примеров запустите дев-сервер с подходящей конфигурацией:
26
- ```bash
27
- # карта рынка на стандартном порту 4200
28
- ng serve stockchart-treemap-examples
29
-
30
- # вариант с собственными цветами на порту 4200
31
- ng serve stockchart-treemap-examples --configuration self-colored
32
- ```
33
-
34
- ## Подключение
35
- ```ts
36
- import { bootstrapApplication } from '@angular/platform-browser';
37
- import { AppComponent } from './app/app.component';
38
- import { TreeMapComponent } from 'stockchart-treemap';
39
-
40
- bootstrapApplication(AppComponent, {
41
- providers: [
42
- // TreeMapComponent подключается как standalone в импортах компонентов
43
- ]
44
- });
45
- ```
46
-
47
- В компоненте-доме добавьте `TreeMapComponent` или готовые демо-обёртки в секцию `imports` и используйте селектор
48
- `<stockchart-treemap>` прямо в шаблоне.
49
-
50
- ## Пример «app-stockchart-treemap» с сгенерированными данными
51
- ```ts
52
- import { AppStockchartTreemapExampleComponent, createMockMarketMap } from 'stockchart-treemap';
53
-
54
- @Component({
55
- standalone: true,
56
- imports: [AppStockchartTreemapExampleComponent]
57
- })
58
- export class DemoHost {}
59
- ```
60
-
61
- Компонент сам генерирует дерево с секторами и тикерами, выставляет `colorValueField: 'change'` и
62
- использует `TreeMapColorScale` для плавной подсветки приростов и падений.
63
-
64
- ## Базовое использование с авторасчётом цветов
65
- ```html
66
- <stockchart-treemap
67
- [data]="data"
68
- [options]="{ textField: 'name', valueField: 'value', colorValueField: 'change', colorScale: performanceColorScale }">
69
- </stockchart-treemap>
70
- ```
71
- ```ts
72
- import { performanceColorScale, createPerformanceTreemap } from 'stockchart-treemap';
73
-
74
- @Component({
75
- standalone: true,
76
- imports: [TreeMapComponent]
77
- })
78
- export class SimpleDemo {
79
- data = createPerformanceTreemap();
80
- options = {
81
- textField: 'name',
82
- valueField: 'value',
83
- colorValueField: 'change',
84
- colorScale: performanceColorScale,
85
- colors: []
86
- };
87
- }
88
- ```
89
-
90
- Плитки не содержат поля `color`, поэтому библиотека самостоятельно рассчитывает оттенки на основе значений из `change`.
1
+ # stockchart-treemap
2
+
3
+ Standalone TreeMap component for Angular, ready to publish to npm. This is an independent port of the Kendo TreeMap functionality implemented on fully independent code (no Kendo UI runtime dependencies). The component is standalone, supports highlighting via `TreeMapColorScale`, accepts array/Observable/loader data sources, and lets you supply custom tile and header templates.
4
+
5
+ ## Live demo
6
+ - Updated StackBlitz example: https://stackblitz.com/edit/stackblitz-starters-drgync8z?file=README.md
7
+
8
+ ## Build and publish
9
+ 1. Build the library:
10
+ ```bash
11
+ npm run ng -- build stockchart-treemap
12
+ ```
13
+ 2. Publish from the build output (make sure you are authenticated in npm):
14
+ ```bash
15
+ cd dist/stockchart-treemap
16
+ npm publish --access public
17
+ ```
18
+
19
+ ## Build example components for debugging
20
+ For local testing and step-by-step debugging of the demo components, build the separate `stockchart-treemap-examples` package:
21
+ ```bash
22
+ npm run build:stockchart-treemap-examples
23
+ ```
24
+ The build uses the examples tsconfig and places artifacts in `dist/stockchart-treemap-examples` so they can be consumed in a sandbox or external app without touching the main package.
25
+
26
+ To view the examples live, run the dev server with the desired configuration:
27
+ ```bash
28
+ # market map on the default 4200 port
29
+ ng serve stockchart-treemap-examples
30
+
31
+ # variant with custom colors on port 4200
32
+ ng serve stockchart-treemap-examples --configuration self-colored
33
+ ```
34
+
35
+ ## Bootstrapping
36
+ ```ts
37
+ import { bootstrapApplication } from '@angular/platform-browser';
38
+ import { AppComponent } from './app/app.component';
39
+ import { TreeMapComponent } from 'stockchart-treemap';
40
+
41
+ bootstrapApplication(AppComponent, {
42
+ providers: [
43
+ // TreeMapComponent is added as a standalone import on the components that use it
44
+ ]
45
+ });
46
+ ```
47
+
48
+ Add `TreeMapComponent` or the ready-made demo wrappers to the `imports` of the host component and use the `<stockchart-treemap>` selector directly in the template.
49
+
50
+ ## Example `<app-stockchart-treemap>` with generated data
51
+ ```ts
52
+ import { AppStockchartTreemapExampleComponent, createMockMarketMap } from 'stockchart-treemap';
53
+
54
+ @Component({
55
+ standalone: true,
56
+ imports: [AppStockchartTreemapExampleComponent]
57
+ })
58
+ export class DemoHost {}
59
+ ```
60
+
61
+ The example component generates a tree with sectors and tickers, sets `colorValueField: 'change'`, and applies `TreeMapColorScale` for smooth gain/loss highlighting.
62
+
63
+ ## Basic usage with automatic colors
64
+ ```html
65
+ <stockchart-treemap
66
+ [data]="data"
67
+ [options]="{ textField: 'name', valueField: 'value', colorValueField: 'change', colorScale: performanceColorScale }">
68
+ </stockchart-treemap>
69
+ ```
70
+ ```ts
71
+ import { performanceColorScale, createPerformanceTreemap } from 'stockchart-treemap';
72
+
73
+ @Component({
74
+ standalone: true,
75
+ imports: [TreeMapComponent]
76
+ })
77
+ export class SimpleDemo {
78
+ data = createPerformanceTreemap();
79
+ options = {
80
+ textField: 'name',
81
+ valueField: 'value',
82
+ colorValueField: 'change',
83
+ colorScale: performanceColorScale,
84
+ colors: []
85
+ };
86
+ }
87
+ ```
88
+
89
+ Tiles omit the `color` field, so the library computes shades automatically from `change`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stockchart-treemap",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Standalone Angular treemap component with StockChart-themed demos and mock data generators.",
5
5
  "keywords": [
6
6
  "angular",