@pulzr/perses-figure-panel 0.2.1 → 0.4.0

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 (56) hide show
  1. package/README.md +26 -0
  2. package/__mf/js/{PulzrFigurePanel.577b888ef4.js → PulzrFigurePanel.bf7939ff93.js} +4 -4
  3. package/__mf/js/async/{0.325dac5c70.js → 0.6258e412aa.js} +2 -2
  4. package/__mf/js/async/0p.ac41951f88.js +2 -0
  5. package/__mf/js/async/2.d6d514458f.js +2 -0
  6. package/__mf/js/async/6.68f450e667.js +1 -0
  7. package/__mf/js/async/{9.952436a6ee.js → 9.b7a842e7df.js} +1 -1
  8. package/__mf/js/async/__federation_expose_PulzrFigurePanel.9611e4f48f.js +1 -0
  9. package/__mf/js/async/{f.daba8eec81.js → f.287458ee3b.js} +2 -2
  10. package/__mf/js/async/k.c04645b420.js +1 -0
  11. package/__mf/js/async/kk.f348b428da.js +1 -0
  12. package/__mf/js/async/kx.49c84b1c51.js +83 -0
  13. package/__mf/js/async/kx.49c84b1c51.js.LICENSE.txt +55 -0
  14. package/__mf/js/async/mt.781853f15e.js +92 -0
  15. package/__mf/js/async/{b.5f50cdb328.js.LICENSE.txt → mt.781853f15e.js.LICENSE.txt} +0 -25
  16. package/__mf/js/async/o.9ef93c3d4a.js +1 -0
  17. package/__mf/js/async/{os.7ddd6e9621.js → os.d56e539d46.js} +2 -2
  18. package/__mf/js/async/p.60ab86d6d6.js +2 -0
  19. package/__mf/js/async/s.ffd9fa8239.js +1 -0
  20. package/__mf/js/{main.d9b3dd4bc6.js → main.c3a0244608.js} +4 -4
  21. package/lib/panels/pulzr-figure-panel/PulzrFigurePanelComponent.d.ts +4 -1
  22. package/lib/panels/pulzr-figure-panel/PulzrFigurePanelComponent.d.ts.map +1 -1
  23. package/lib/panels/pulzr-figure-panel/PulzrFigurePanelComponent.js +528 -119
  24. package/lib/panels/pulzr-figure-panel/PulzrFigurePanelComponent.js.map +1 -1
  25. package/lib/panels/pulzr-figure-panel/PulzrFigurePanelSettingsEditor.d.ts.map +1 -1
  26. package/lib/panels/pulzr-figure-panel/PulzrFigurePanelSettingsEditor.js +128 -51
  27. package/lib/panels/pulzr-figure-panel/PulzrFigurePanelSettingsEditor.js.map +1 -1
  28. package/lib/panels/pulzr-figure-panel/figure.d.ts +25 -6
  29. package/lib/panels/pulzr-figure-panel/figure.d.ts.map +1 -1
  30. package/lib/panels/pulzr-figure-panel/figure.js +43 -11
  31. package/lib/panels/pulzr-figure-panel/figure.js.map +1 -1
  32. package/lib/panels/pulzr-figure-panel/pulzr-figure-panel-types.d.ts +22 -2
  33. package/lib/panels/pulzr-figure-panel/pulzr-figure-panel-types.d.ts.map +1 -1
  34. package/lib/panels/pulzr-figure-panel/pulzr-figure-panel-types.js.map +1 -1
  35. package/mf-manifest.json +19 -19
  36. package/mf-stats.json +19 -19
  37. package/package.json +1 -1
  38. package/__mf/js/async/0p.68da90f323.js +0 -2
  39. package/__mf/js/async/2.18619a1037.js +0 -2
  40. package/__mf/js/async/5.9d2ef52231.js +0 -83
  41. package/__mf/js/async/5.9d2ef52231.js.LICENSE.txt +0 -30
  42. package/__mf/js/async/6.02956de769.js +0 -1
  43. package/__mf/js/async/__federation_expose_PulzrFigurePanel.e4e9ee3624.js +0 -1
  44. package/__mf/js/async/b.5f50cdb328.js +0 -92
  45. package/__mf/js/async/k.7c4213442a.js +0 -1
  46. package/__mf/js/async/kk.c246b3edb4.js +0 -1
  47. package/__mf/js/async/o.0d1a3636bd.js +0 -1
  48. package/__mf/js/async/p.3fb8172ba3.js +0 -2
  49. package/__mf/js/async/s.f71e79b6e1.js +0 -1
  50. /package/__mf/css/async/{b.7481ca0159.css → mt.7481ca0159.css} +0 -0
  51. /package/__mf/js/async/{0.325dac5c70.js.LICENSE.txt → 0.6258e412aa.js.LICENSE.txt} +0 -0
  52. /package/__mf/js/async/{0p.68da90f323.js.LICENSE.txt → 0p.ac41951f88.js.LICENSE.txt} +0 -0
  53. /package/__mf/js/async/{2.18619a1037.js.LICENSE.txt → 2.d6d514458f.js.LICENSE.txt} +0 -0
  54. /package/__mf/js/async/{f.daba8eec81.js.LICENSE.txt → f.287458ee3b.js.LICENSE.txt} +0 -0
  55. /package/__mf/js/async/{os.7ddd6e9621.js.LICENSE.txt → os.d56e539d46.js.LICENSE.txt} +0 -0
  56. /package/__mf/js/async/{p.3fb8172ba3.js.LICENSE.txt → p.60ab86d6d6.js.LICENSE.txt} +0 -0
package/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Figure panel for Perses
2
2
 
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="https://github.com/pulzar-net/perses-figure-panel/releases/latest/download/preview-dark.png">
5
+ <img alt="The PulzrFigurePanel: occupancy as a figure with its change, a sparkline under it and rows of sessions, typical stay and turnover" src="https://github.com/pulzar-net/perses-figure-panel/releases/latest/download/preview-light.png">
6
+ </picture>
7
+
3
8
  `PulzrFigurePanel` draws one figure, large and light, and under it how it changed against the period before: `↓ -47.3% vs last week`, in the theme's success or error color. A dashboard's headline row: average occupancy, sessions, revenue.
4
9
 
5
10
  ```yaml
@@ -22,8 +27,29 @@ spec:
22
27
  - `timeInParts` says a time as people do, `6h 46m` rather than `6.8h`, when `format` is in seconds, minutes or hours.
23
28
  - `subtitle` is a line under the title and `detail` a small box under the figure, each filled from the query's series: `{{name}}` is that series' value, `{{name|%}}` the value as a percent. `of {{booked_space_hours}} booked hours, occupied`.
24
29
  - `changeStyle: size` reads the change as its size, `↑ 35.8% vs previous period`: whole past 100%, `0%` within a twentieth of one, colored by good or bad news. The default, `signed`, is `↑ +0.7% vs last week`, flat within half a percent.
30
+ - `changeStyle: badge` puts the change small beside the figure, `↗ 133%`, sized as `size` and colored by good or bad news, with no compared label; the figure is bold, as on the console's Overview cards. `caption` shows under it when there is nothing to compare with.
31
+ - `sparkline: {series, color}` draws an area under the figure, 32px high, of every value over time of the series named (any query of the panel, for example one by day); `color` is the figure's unless set.
32
+ - `rows` lists figures under the figure, each a line: `label` on the left, on the right the last value of the series named `series`, formatted by its `format` (and `timeInParts`), and its change as a badge against that series' twin, `<series> · previous period` or `<series> · last year`, when there is one (`lowerIsBetter` per row). `suffix` puts words after the value: `1.8 / space / day`.
33
+ - The figure is the first series that is neither the sparkline's nor a row's, and its period before is its own twin by name (`<figure> · previous period`), so one query can ask for several measures compared.
25
34
  - `of: {series, label}` shows a rate as a count of a total beside it, `1690/2639 Spaces Occupied`: the total is the last value of the series named `series`, which the same query asks for (for example `measures: [peak_rate, spaces]`).
26
35
 
36
+ A pillar, as the Overview has them:
37
+
38
+ ```yaml
39
+ spec:
40
+ plugin:
41
+ kind: PulzrFigurePanel
42
+ spec:
43
+ format: { unit: percent-decimal, decimalPlaces: 1 }
44
+ color: '#10b981'
45
+ changeStyle: badge
46
+ sparkline: { series: Occupancy by day }
47
+ rows:
48
+ - { label: Sessions, series: Sessions, format: { unit: decimal, decimalPlaces: 0 } }
49
+ - { label: Typical stay, series: Typical stay, format: { unit: minutes }, timeInParts: true }
50
+ - { label: Turnover, series: Turnover, format: { unit: decimal, decimalPlaces: 1 } }
51
+ ```
52
+
27
53
  ## Install
28
54
 
29
55
  Put the archive (`PulzrFigurePanel-<version>.tar.gz`, from the releases) in a folder listed in the Perses server's `plugin.archive_paths`, or `npm install @pulzr/perses-figure-panel` to embed it.