zinkee 0.1.67 → 0.1.68

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.
package/README.md CHANGED
@@ -806,12 +806,22 @@ zinkee --json displays widgets create <display-uuid> \
806
806
  "kpi":{"typeCalc":"SUM","fieldCalc":"hours-field-slug"}
807
807
  }'
808
808
 
809
- # Chart widget (valid types: lines, bars, stackedBars, combined)
809
+ # Chart widget. Types: lines, bars (columns), horizontalBars (one category per
810
+ # row, for rankings), stackedBars, combined (PRIMARY series as columns,
811
+ # SECONDARY series as lines on a right-hand axis). --chart-sort-order
812
+ # (alphabetical, valueDesc, valueAsc) orders the categories by the first
813
+ # series. Only bars and horizontalBars sort by value, and a chart grouped by a
814
+ # date is always chronological: a value order there fails with
815
+ # display_widget_chart_sort_order_not_applicable. Change the order of an
816
+ # existing chart with `displays widgets update <display> <widget>
817
+ # --chart-sort-order valueAsc`. legend and series color are accepted but have
818
+ # no effect: the legend and the colours are automatic.
810
819
  zinkee --json displays widgets create <display-uuid> \
811
820
  --type CHART \
812
821
  --name "Hours by Employee" \
813
822
  --origin-resource <hours-schema-uuid> \
814
- --chart-type bars \
823
+ --chart-type horizontalBars \
824
+ --chart-sort-order valueDesc \
815
825
  --x-axis-field employee-field-slug \
816
826
  --raw '{
817
827
  "bindings":{"variableMap":{"<variable-uuid>":"<hours-project-field-uuid>"}},
@@ -1848,7 +1848,7 @@ var specificExamples = {
1848
1848
  },
1849
1849
  {
1850
1850
  description: "Create a CHART widget with a daily time-serie x-axis.",
1851
- command: `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type CHART --name "Revenue by day" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":8,"h":6}' --chart-type lines --x-axis-field due-date --x-axis-date-format DATE --x-axis-time-series --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","color":"#4B9CD3","axisType":"PRIMARY"}' --legend '{"position":"bottom"}'`,
1851
+ command: `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type CHART --name "Revenue by day" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":8,"h":6}' --chart-type lines --x-axis-field due-date --x-axis-date-format DATE --x-axis-time-series --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","axisType":"PRIMARY"}'`,
1852
1852
  raw: `{
1853
1853
  "type": "CHART",
1854
1854
  "source": {
@@ -1868,17 +1868,42 @@ var specificExamples = {
1868
1868
  {
1869
1869
  "typeCalc": "SUM",
1870
1870
  "fieldCalc": "amount",
1871
- "color": "#4B9CD3",
1872
1871
  "axisType": "PRIMARY"
1873
1872
  }
1874
- ],
1875
- "legend": { "position": "bottom" }
1873
+ ]
1876
1874
  }
1877
1875
  }`
1878
1876
  },
1879
1877
  {
1880
- description: "Create a bars CHART widget with a monthly time-serie x-axis and two y-axis series.",
1881
- command: `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type CHART --name "Revenue by month" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":8,"h":6}' --chart-type bars --x-axis-field due-date --x-axis-date-format MONTH_YEAR --x-axis-time-series --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","color":"#4B9CD3","axisType":"PRIMARY"}' --y-axis-serie '{"typeCalc":"COUNT","fieldCalc":"contact-name","color":"#E57373","axisType":"SECONDARY"}' --legend '{"position":"bottom"}'`,
1878
+ description: "Create a ranking: horizontal bars (one category per row, names readable) sorted from highest to lowest value. sortOrder (alphabetical, valueDesc, valueAsc) applies to bars and horizontalBars by the first series; date axes stay chronological.",
1879
+ command: `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type CHART --name "Revenue by customer" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":6,"h":8}' --chart-type horizontalBars --chart-sort-order valueDesc --x-axis-field contact-name --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","axisType":"PRIMARY"}'`,
1880
+ raw: `{
1881
+ "type": "CHART",
1882
+ "source": {
1883
+ "originResourceId": "2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e",
1884
+ "isOriginSubSchema": false
1885
+ },
1886
+ "placement": {
1887
+ "layout": { "x": 0, "y": 0, "w": 6, "h": 8 }
1888
+ },
1889
+ "presentation": { "name": "Revenue by customer" },
1890
+ "chart": {
1891
+ "chartType": "horizontalBars",
1892
+ "sortOrder": "valueDesc",
1893
+ "xAxisFieldId": "contact-name",
1894
+ "yAxisSeries": [
1895
+ {
1896
+ "typeCalc": "SUM",
1897
+ "fieldCalc": "amount",
1898
+ "axisType": "PRIMARY"
1899
+ }
1900
+ ]
1901
+ }
1902
+ }`
1903
+ },
1904
+ {
1905
+ description: "Create a combined CHART widget by month: the PRIMARY series is drawn as columns and the SECONDARY series as a line on its own right-hand axis.",
1906
+ command: `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type CHART --name "Revenue by month" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":8,"h":6}' --chart-type combined --x-axis-field due-date --x-axis-date-format MONTH_YEAR --x-axis-time-series --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","axisType":"PRIMARY"}' --y-axis-serie '{"typeCalc":"COUNT","fieldCalc":"contact-name","axisType":"SECONDARY"}'`,
1882
1907
  raw: `{
1883
1908
  "type": "CHART",
1884
1909
  "source": {
@@ -1890,7 +1915,7 @@ var specificExamples = {
1890
1915
  },
1891
1916
  "presentation": { "name": "Revenue by month" },
1892
1917
  "chart": {
1893
- "chartType": "bars",
1918
+ "chartType": "combined",
1894
1919
  "xAxisFieldId": "due-date",
1895
1920
  "xAxisDateFormat": "MONTH_YEAR",
1896
1921
  "xAxisAsTimeSerie": true,
@@ -1898,23 +1923,20 @@ var specificExamples = {
1898
1923
  {
1899
1924
  "typeCalc": "SUM",
1900
1925
  "fieldCalc": "amount",
1901
- "color": "#4B9CD3",
1902
1926
  "axisType": "PRIMARY"
1903
1927
  },
1904
1928
  {
1905
1929
  "typeCalc": "COUNT",
1906
1930
  "fieldCalc": "contact-name",
1907
- "color": "#E57373",
1908
1931
  "axisType": "SECONDARY"
1909
1932
  }
1910
- ],
1911
- "legend": { "position": "bottom" }
1933
+ ]
1912
1934
  }
1913
1935
  }`
1914
1936
  },
1915
1937
  {
1916
1938
  description: "Create a bars CHART widget with a quarterly time-serie x-axis.",
1917
- command: `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type CHART --name "Revenue by quarter" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":8,"h":6}' --chart-type bars --x-axis-field due-date --x-axis-date-format QUARTER_YEAR --x-axis-time-series --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","color":"#4B9CD3","axisType":"PRIMARY"}' --legend '{"position":"bottom"}'`,
1939
+ command: `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type CHART --name "Revenue by quarter" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":8,"h":6}' --chart-type bars --x-axis-field due-date --x-axis-date-format QUARTER_YEAR --x-axis-time-series --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","axisType":"PRIMARY"}'`,
1918
1940
  raw: `{
1919
1941
  "type": "CHART",
1920
1942
  "source": {
@@ -1934,17 +1956,15 @@ var specificExamples = {
1934
1956
  {
1935
1957
  "typeCalc": "SUM",
1936
1958
  "fieldCalc": "amount",
1937
- "color": "#4B9CD3",
1938
1959
  "axisType": "PRIMARY"
1939
1960
  }
1940
- ],
1941
- "legend": { "position": "bottom" }
1961
+ ]
1942
1962
  }
1943
1963
  }`
1944
1964
  },
1945
1965
  {
1946
1966
  description: "Create a CHART widget with a yearly time-serie x-axis.",
1947
- command: `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type CHART --name "Revenue by year" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":8,"h":6}' --chart-type lines --x-axis-field due-date --x-axis-date-format YEAR --x-axis-time-series --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","color":"#4B9CD3","axisType":"PRIMARY"}' --legend '{"position":"bottom"}'`,
1967
+ command: `zinkee --json displays widgets create 0f6f062f-1478-4df2-96a1-c495d037d260 --type CHART --name "Revenue by year" --origin-resource 2eb8bdcf-6d9c-4fbb-9018-7fa8180f4c5e --layout '{"x":0,"y":0,"w":8,"h":6}' --chart-type lines --x-axis-field due-date --x-axis-date-format YEAR --x-axis-time-series --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","axisType":"PRIMARY"}'`,
1948
1968
  raw: `{
1949
1969
  "type": "CHART",
1950
1970
  "source": {
@@ -1964,11 +1984,9 @@ var specificExamples = {
1964
1984
  {
1965
1985
  "typeCalc": "SUM",
1966
1986
  "fieldCalc": "amount",
1967
- "color": "#4B9CD3",
1968
1987
  "axisType": "PRIMARY"
1969
1988
  }
1970
- ],
1971
- "legend": { "position": "bottom" }
1989
+ ]
1972
1990
  }
1973
1991
  }`
1974
1992
  },
@@ -2240,11 +2258,20 @@ var specificExamples = {
2240
2258
  "fieldCalc": "amount",
2241
2259
  "config": { "format": "number", "decimals": 1 }
2242
2260
  }
2261
+ }`
2262
+ },
2263
+ {
2264
+ description: "Sort the categories of a bars or horizontalBars chart from lowest to highest value.",
2265
+ command: `zinkee --json displays widgets update 0f6f062f-1478-4df2-96a1-c495d037d260 22222222-2222-4222-a222-222222222222 --chart-sort-order valueAsc`,
2266
+ raw: `{
2267
+ "chart": {
2268
+ "sortOrder": "valueAsc"
2269
+ }
2243
2270
  }`
2244
2271
  },
2245
2272
  {
2246
2273
  description: "Replace the chart series with quarterly lines.",
2247
- command: `zinkee --json displays widgets update 0f6f062f-1478-4df2-96a1-c495d037d260 22222222-2222-4222-a222-222222222222 --chart-type lines --x-axis-field due-date --x-axis-date-format QUARTER_YEAR --x-axis-time-series --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","color":"#2E7D32","axisType":"PRIMARY"}'`,
2274
+ command: `zinkee --json displays widgets update 0f6f062f-1478-4df2-96a1-c495d037d260 22222222-2222-4222-a222-222222222222 --chart-type lines --x-axis-field due-date --x-axis-date-format QUARTER_YEAR --x-axis-time-series --y-axis-serie '{"typeCalc":"SUM","fieldCalc":"amount","axisType":"PRIMARY"}'`,
2248
2275
  raw: `{
2249
2276
  "chart": {
2250
2277
  "chartType": "lines",
@@ -2255,7 +2282,6 @@ var specificExamples = {
2255
2282
  {
2256
2283
  "typeCalc": "SUM",
2257
2284
  "fieldCalc": "amount",
2258
- "color": "#2E7D32",
2259
2285
  "axisType": "PRIMARY"
2260
2286
  }
2261
2287
  ]
@@ -4786,4 +4812,4 @@ function withResponseEnvelope({ responseMeta, ...example }, commandName) {
4786
4812
  export {
4787
4813
  getCommandExamples
4788
4814
  };
4789
- //# sourceMappingURL=examples-A6YSSKDM.js.map
4815
+ //# sourceMappingURL=examples-BTITPK7X.js.map