Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="License: MIT"></a>
</p>

**Documentation: [powershell-universal-components.eize.dev](https://powershell-universal-components.eize.dev/)**: every module, parameter and chart type, with live examples.

Supported and tested versions: [Requirements](https://powershell-universal-components.eize.dev/#requirements).
**[Documentation](https://powershell-universal-components.eize.dev/)** · [Getting started](https://powershell-universal-components.eize.dev/getting-started/) · [Requirements](https://powershell-universal-components.eize.dev/#requirements) · [Releases](https://github.com/eizedev/powershell-universal-components/releases)

> [!NOTE]
> The modules are 0.x. A minor release can break things, so read the module's `CHANGELOG.md` before
Expand All @@ -30,7 +28,7 @@ Supported and tested versions: [Requirements](https://powershell-universal-compo

### ECharts

<img src="assets/screenshot-service-review-light.png" alt="ECharts: a service review page with a KPI matrix of sparklines and bar charts" width="100%">
<picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/echarts-weather-dark.png"><img src="docs/assets/echarts-weather-light.png" alt="ECharts: monthly mean temperature of six cities in 2024 and 2025 as lines, with a zoom slider" width="100%"></picture>

`New-UDEChart` draws 29 [Apache ECharts](https://echarts.apache.org/) chart types, from bars and lines to gantt
charts, network graphs, and KPI matrices. Clicks filter other elements. Readers zoom, export, and go full screen.
Expand All @@ -40,17 +38,17 @@ charts, network graphs, and KPI matrices. Clicks filter other elements. Readers

### Pivot

<picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/pivot-report-dark.png"><img src="docs/assets/pivot-report-light.png" alt="Pivot: report builder with field list, zones and a table" width="100%"></picture>
<picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/pivot-weather-dark.png"><img src="docs/assets/pivot-weather-light.png" alt="Pivot: mean temperature per month and city of six cities as a colour scale from blue to orange, with the tabs Table, Chart and Both" width="100%"></picture>

`New-UDPivotReport` is a pivot report builder on [pivotkit](https://github.com/eizedev/pivotkit). Readers drag
`New-UDPivotReport` is a pivot report builder on [pivotkit](https://pivotkit.eize.dev/) ([live demo](https://pivotkit.eize.dev/demo/)). Readers drag
fields into rows, columns, values and filters and get a table or a chart. They save views and export to Excel.

- [Docs](https://powershell-universal-components.eize.dev/pivot/) · [PowerShell Gallery](https://www.powershellgallery.com/packages/PowerShellUniversal.Component.Pivot)
- Showcase app with weather data, your own files and a ticket report: [Docs](https://powershell-universal-components.eize.dev/pivot/demo/) · [PowerShell Gallery](https://www.powershellgallery.com/packages/PowerShellUniversal.Component.Pivot.Demo)

### Perspective

<picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/perspective-viewer-1-dark.png"><img src="docs/assets/perspective-viewer-1-light.png" alt="Perspective: datagrid grouped and split by the reader" width="100%"></picture>
<picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/perspective-weather-dark.png"><img src="docs/assets/perspective-weather-light.png" alt="Perspective: a bar chart of the mean temperature of six cities, with the toolbar Edit view, Table and Chart" width="100%"></picture>

`New-UDPerspective` is the [Perspective](https://perspective-dev.github.io/) datagrid, pivot table, and WebGL
charts in one. Readers group, split, filter, and sort. A WebAssembly engine handles large row counts.
Expand Down Expand Up @@ -106,4 +104,5 @@ Contributors and coding agents: [PRODUCT.md](PRODUCT.md), [AGENTS.md](AGENTS.md)

[MIT](LICENSE). Bundled libraries keep their own licenses. The build writes their texts into each module's `THIRD-PARTY-NOTICES.txt`.
Icon, header and social preview in `assets/` are generated in [eizedev/brand](https://github.com/eizedev/brand)
and licensed [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
and licensed [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). The weather in the screenshots: data by
[Open-Meteo.com](https://open-meteo.com/), [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), with modified Copernicus Climate Change Service information ([sources](docs/site/data/SOURCES.md)).
6 changes: 3 additions & 3 deletions build/growth-baseline.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"docs": {
"pages": {
"README.md": [109]
"README.md": [108]
},
"totalLines": 4358
"totalLines": 4369
},
"javascript": {
"complexity": {
Expand All @@ -22,7 +22,7 @@
},
"powershell": {
"files": {
"docs/site/examples.ps1": [510],
"docs/site/examples.ps1": [552],
"modules/PowerShellUniversal.Component.ECharts.Demo/Apps/Showcase.ps1": [1330],
"modules/PowerShellUniversal.Component.Pivot.Demo/Apps/Showcase.ps1": [305],
"tests/powershell/Pivot.Tests.ps1": [521],
Expand Down
Binary file added docs/assets/echarts-weather-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/echarts-weather-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/perspective-weather-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/perspective-weather-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/assets/pivot-report-dark.png
Binary file not shown.
Binary file removed docs/assets/pivot-report-light.png
Binary file not shown.
Binary file added docs/assets/pivot-weather-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pivot-weather-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/development/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ of these sections; `tests/js/llms-sections.test.js` fails otherwise.
| --- | --- |
| An example's text | `Text` in `examples.ps1`; parameters (`-View`), commands (`New-UDDynamic`) and variables (`$EventData`) become code. |
| An example as a whole app | `App` in `examples.ps1` (the app's title): the page shows the code once more inside `New-UDApp -Content { }`. |
| Public data in an example | `Invoke-RestMethod` with the real address; the build answers it from the snapshot in `docs/site/data/<host>/<path>`, so it needs no network. `docs/site/Update-Data.ps1` fetches the snapshots again; sources, licences and the attribution each source asks for (`Source` in `examples.ps1`, shown under the example) are in [data/SOURCES.md](https://github.com/eizedev/powershell-universal-components/blob/HEAD/docs/site/data/SOURCES.md). |
| Public data in an example | `Invoke-RestMethod` with the real address; the build answers it from the snapshot in `docs/site/data/<host>/<path>` (for an address with a query string, the file `data/Addresses.psd1` names), so it needs no network. `docs/site/Update-Data.ps1` fetches the snapshots again; sources, licences and the attribution each source asks for (`Source` in `examples.ps1`, shown under the example) are in [data/SOURCES.md](https://github.com/eizedev/powershell-universal-components/blob/HEAD/docs/site/data/SOURCES.md). |
| The pivot showcase app | Runs the pivot examples of `examples.ps1` and reads the snapshots in `docs/site/data/` (`Addresses.psd1` holds the exact address of a snapshot whose address has a query string); `Build.psd1` of the demo module copies both into it, so a change of an example or a snapshot reaches the app with its next release. |
| What PSU provides | Stubs in `Build-Site.ps1`: the `[Endpoint]` type, `New-UDDynamic` (draws its `-Content`), a signed-in reader with the role `Administrator` (`$User`, `$Roles`) and `$Repository`. |
| The pivot report on a page | Drawn into a shadow root of its placeholder, with the module's stylesheets inside it, so the page's typography stays outside. |
| The pivot screenshots of the start page | `node docs/site/screenshots.mjs <site url>` on the built and served site, light and dark, into `docs/assets/`. |
| The screenshots of the README and the start page (`echarts-weather-*`, `perspective-weather-*`, `pivot-weather-*`) | `node docs/site/screenshots.mjs <site url>` on the built and served site, light and dark, into `docs/assets/`. |
| The Pivot showcase screenshots (`pivot-showcase-*`) | `PSU_PIVOT_DEMO_URL=<app url> node docs/site/screenshots.mjs` against `New-UDPivotShowcase` on a PSU instance, light and dark, into `docs/assets/`. |

## Browser tests on PSU
Expand Down
4 changes: 4 additions & 0 deletions docs/echarts/lines-and-time.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ lines, `-SecondaryY` puts named series on a second axis, `-LogScale` makes the v

--8<-- "examples/time-axis-with-zoom-and-a-reference-line.md"

## Temperature of six cities

--8<-- "examples/temperature-of-six-cities.md"

## Reference lines and pins

`-MarkLine 'median', 'average'` per series, or fixed lines: `@{ value = 48; name = 'SLA'; color = '#e53935' }`
Expand Down
14 changes: 7 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Install-PSResource -Name PowerShellUniversal.Component.ECharts

In the PowerShell Gallery: [PowerShellUniversal.Component.ECharts](https://www.powershellgallery.com/packages/PowerShellUniversal.Component.ECharts).

![The quick start app in the light theme: stacked bars of PowerShell commands per verb, cmdlets and functions](assets/images/screenshot-quickstart-light.png#only-light)
![The quick start app in the dark theme: stacked bars of PowerShell commands per verb, cmdlets and functions](assets/images/screenshot-quickstart-dark.png#only-dark)
![ECharts in the light theme: monthly mean temperature of six cities in 2024 and 2025 as lines, with a zoom slider](assets/echarts-weather-light.png#only-light)
![ECharts in the dark theme: monthly mean temperature of six cities in 2024 and 2025 as lines, with a zoom slider](assets/echarts-weather-dark.png#only-dark)

[ECharts overview](echarts/index.md){ .md-button .md-button--primary }
[Showcase app (demo)](demo.md){ .md-button title="PowerShellUniversal.Component.ECharts.Demo: 14 pages of New-UDEChart examples" }
Expand All @@ -53,8 +53,8 @@ Install-PSResource -Name PowerShellUniversal.Component.Perspective

In the PowerShell Gallery: [PowerShellUniversal.Component.Perspective](https://www.powershellgallery.com/packages/PowerShellUniversal.Component.Perspective).

![The Perspective viewer in the light theme with its toolbar: Edit view, Table and Chart](assets/perspective-viewer-1-light.png#only-light)
![The Perspective viewer in the dark theme with its toolbar: Edit view, Table and Chart](assets/perspective-viewer-1-dark.png#only-dark)
![The Perspective viewer in the light theme: a bar chart of the mean temperature of six cities, with the toolbar Edit view, Table and Chart](assets/perspective-weather-light.png#only-light)
![The Perspective viewer in the dark theme: a bar chart of the mean temperature of six cities, with the toolbar Edit view, Table and Chart](assets/perspective-weather-dark.png#only-dark)

[Perspective overview](perspective/index.md){ .md-button .md-button--primary }
[Using the viewer](perspective/using.md){ .md-button }
Expand All @@ -77,10 +77,10 @@ New-UDPivotReport -Id 'python' -Data (Invoke-RestMethod 'https://endoflife.date/

In the PowerShell Gallery: [PowerShellUniversal.Component.Pivot](https://www.powershellgallery.com/packages/PowerShellUniversal.Component.Pivot).

![The pivot report in the light theme: release cycles of nine products from endoflife.date per product and LTS, with the field list and the admin panel](assets/pivot-report-light.png#only-light)
![The pivot report in the dark theme: release cycles of nine products from endoflife.date per product and LTS, with the field list and the admin panel](assets/pivot-report-dark.png#only-dark)
![The pivot report in the light theme: mean temperature per month and city of six cities as a colour scale, with the tabs Table, Chart and Both](assets/pivot-weather-light.png#only-light)
![The pivot report in the dark theme: mean temperature per month and city of six cities as a colour scale, with the tabs Table, Chart and Both](assets/pivot-weather-dark.png#only-dark)

<small>Release data by [endoflife.date](https://endoflife.date/), MIT licence, Copyright 2020 endoflife.date contributors ([sources and licence](https://github.com/eizedev/powershell-universal-components/blob/HEAD/docs/site/data/SOURCES.md)).</small>
<small>The pictures on this page: weather data by [Open-Meteo.com](https://open-meteo.com/), [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), with modified Copernicus Climate Change Service information ([sources and licences](https://github.com/eizedev/powershell-universal-components/blob/HEAD/docs/site/data/SOURCES.md)).</small>

[Pivot overview](pivot/index.md){ .md-button .md-button--primary }
[Templates, view files and roles](pivot/templates.md){ .md-button }
Expand Down
4 changes: 4 additions & 0 deletions docs/perspective/view.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ of expression columns from `-Config` count as columns.

--8<-- "examples/pivot-tickets-per-team-and-priority.md"

## Temperature per city

--8<-- "examples/temperature-per-city.md"

## Perspective chart: open tickets per team

--8<-- "examples/perspective-chart-open-tickets-per-team.md"
Expand Down
4 changes: 4 additions & 0 deletions docs/pivot/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ To see it with data first, the [showcase app](demo.md) is a module of its own

--8<-- "examples/pivot-report-from-a-web-api.md"

## Weather of six cities

--8<-- "examples/weather-of-six-cities.md"

Then, depending on what the report needs:

| You want | Where |
Expand Down
12 changes: 9 additions & 3 deletions docs/site/Build-Site.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,19 @@ $moduleNames = @(Get-ChildItem -LiteralPath $modulesDir -Directory | Sort-Object

# PSU's endpoint type, as in the Pester tests: event script blocks become a marker the page replaces
. (Join-Path $repo 'build' 'Add-EndpointType.ps1')
# a public API in an example: the snapshot of that address in data/ (data/<host>/<path>), returned as
# Invoke-RestMethod returns JSON (an array is one object in the pipeline, as there)
# a public API in an example: the snapshot of that address in data/ (data/<host>/<path>, or the file
# data/Addresses.psd1 names for an address with a query string), returned as Invoke-RestMethod returns
# JSON (an array is one object in the pipeline, as there)
$snapshotOf = Import-PowerShellDataFile -LiteralPath (Join-Path $site 'data' 'Addresses.psd1')
function Invoke-RestMethod {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidOverwritingBuiltInCmdlets', '', Justification = 'Answers the examples from snapshots while the site is built')]
param([Parameter(Mandatory, Position = 0)][uri]$Uri)
$file = Join-Path $site 'data' $Uri.Host $Uri.AbsolutePath.TrimStart('/')
if ($Uri.Scheme -ne 'https' -or $Uri.Query -or -not (Test-Path -LiteralPath $file -PathType Leaf)) {
if ($Uri.Query) {
$path = $snapshotOf.Keys | Where-Object { $snapshotOf[$_] -eq $Uri.OriginalString } | Select-Object -First 1
$file = if ($path) { Join-Path $site 'data' $path }
}
if ($Uri.Scheme -ne 'https' -or -not $file -or -not (Test-Path -LiteralPath $file -PathType Leaf)) {
throw "No snapshot of $Uri in docs/site/data/ (see data/SOURCES.md)."
}
Get-Content -LiteralPath $file -Raw | ConvertFrom-Json -NoEnumerate
Expand Down
3 changes: 2 additions & 1 deletion docs/site/data/Addresses.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Every other file is the answer of https://<its path below data/> (Update-Data.ps1).
@{
# daily weather of six cities (Berlin, London, Madrid, New York, Tokyo, Sydney), 2024 and 2025;
# the showcase app of PowerShellUniversal.Component.Pivot.Demo asks for exactly this address
# the showcase app of PowerShellUniversal.Component.Pivot.Demo and the weather examples of
# ../examples.ps1 ask for exactly this address
'archive-api.open-meteo.com/v1/archive.json' = 'https://archive-api.open-meteo.com/v1/archive?latitude=52.52,51.51,40.42,40.71,35.69,-33.87&longitude=13.41,-0.13,-3.70,-74.01,139.69,151.21&start_date=2024-01-01&end_date=2025-12-31&daily=temperature_2m_max,temperature_2m_min,temperature_2m_mean,precipitation_sum,sunshine_duration&timezone=auto'
}
Loading
Loading