Codegen: Render constraints in generated docs (#63196)

* Add constraints rendering

* Generate docs

* Fix constraint format

* Add type alias

* Compare numbers as strings

* fixup! Compare numbers as strings

* Add missing return
This commit is contained in:
Tania
2023-02-10 12:40:50 +01:00
committed by GitHub
parent 7f6a1c06a6
commit f0333ac41f
11 changed files with 131 additions and 45 deletions
@@ -32,10 +32,10 @@ It extends [AxisConfig](#axisconfig) and [HideableFieldConfig](#hideablefieldcon
| `axisSoftMax` | number | No | *(Inherited from [AxisConfig](#axisconfig))* |
| `axisSoftMin` | number | No | *(Inherited from [AxisConfig](#axisconfig))* |
| `axisWidth` | number | No | *(Inherited from [AxisConfig](#axisconfig))* |
| `fillOpacity` | integer | No | Controls the fill opacity of the bars. Default: `80`. |
| `fillOpacity` | integer | No | Controls the fill opacity of the bars. Default: `80`.<br/>Constraint: `>=0 & <=100`. |
| `gradientMode` | string | No | TODO docs<br/>Possible values are: `none`, `opacity`, `hue`, `scheme`. |
| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | *(Inherited from [HideableFieldConfig](#hideablefieldconfig))*<br/>TODO docs |
| `lineWidth` | integer | No | Controls line width of the bars. Default: `1`. |
| `lineWidth` | integer | No | Controls line width of the bars. Default: `1`.<br/>Constraint: `>=0 & <=10`. |
| `scaleDistribution` | [ScaleDistributionConfig](#scaledistributionconfig) | No | *(Inherited from [AxisConfig](#axisconfig))*<br/>TODO docs |
| `thresholdsStyle` | [GraphThresholdsStyleConfig](#graphthresholdsstyleconfig) | No | TODO docs |
@@ -97,21 +97,21 @@ It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#opt
| Property | Type | Required | Description |
|-----------------------|-------------------------------------------------|----------|------------------------------------------------------------------------------------------------------------------------------------|
| `barWidth` | number | **Yes** | Controls the width of bars. 1 = Max width, 0 = Min width. Default: `0.97`. |
| `barWidth` | number | **Yes** | Controls the width of bars. 1 = Max width, 0 = Min width. Default: `0.97`.<br/>Constraint: `>=0 & <=1`. |
| `fullHighlight` | boolean | **Yes** | Enables mode which highlights the entire bar area and shows tooltip when cursor<br/>hovers over highlighted area Default: `false`. |
| `groupWidth` | number | **Yes** | Controls the width of groups. 1 = max with, 0 = min width. Default: `0.7`. |
| `groupWidth` | number | **Yes** | Controls the width of groups. 1 = max with, 0 = min width. Default: `0.7`.<br/>Constraint: `>=0 & <=1`. |
| `legend` | [VizLegendOptions](#vizlegendoptions) | **Yes** | *(Inherited from [OptionsWithLegend](#optionswithlegend))*<br/>TODO docs |
| `orientation` | string | **Yes** | TODO docs<br/>Possible values are: `auto`, `vertical`, `horizontal`. |
| `showValue` | string | **Yes** | TODO docs<br/>Possible values are: `auto`, `never`, `always`. |
| `stacking` | string | **Yes** | TODO docs<br/>Possible values are: `none`, `normal`, `percent`. |
| `tooltip` | [VizTooltipOptions](#viztooltipoptions) | **Yes** | *(Inherited from [OptionsWithTooltip](#optionswithtooltip))*<br/>TODO docs |
| `xTickLabelMaxLength` | integer | **Yes** | Sets the max length that a label can have before it is truncated. |
| `xTickLabelRotation` | integer | **Yes** | Controls the rotation of the x axis labels. Default: `0`. |
| `barRadius` | number | No | Controls the radius of each bar. Default: `0`. |
| `xTickLabelMaxLength` | integer | **Yes** | Sets the max length that a label can have before it is truncated.<br/>Constraint: `>=0 & <=2147483647`. |
| `xTickLabelRotation` | integer | **Yes** | Controls the rotation of the x axis labels. Default: `0`.<br/>Constraint: `>=-90 & <=90`. |
| `barRadius` | number | No | Controls the radius of each bar. Default: `0`.<br/>Constraint: `>=0 & <=0.5`. |
| `colorByField` | string | No | Use the color value for a sibling field to color each bar value. |
| `text` | [VizTextDisplayOptions](#viztextdisplayoptions) | No | *(Inherited from [OptionsWithTextFormatting](#optionswithtextformatting))*<br/>TODO docs |
| `xField` | string | No | Manually select which field from the dataset to represent the x field. |
| `xTickLabelSpacing` | integer | No | Controls the spacing between x axis labels.<br/>negative values indicate backwards skipping behavior Default: `0`. |
| `xTickLabelSpacing` | int32 | No | Controls the spacing between x axis labels.<br/>negative values indicate backwards skipping behavior Default: `0`. |
### OptionsWithLegend