Skip to content

Commit

Permalink
Core | Container: Updating jsdoc for width and height
Browse files Browse the repository at this point in the history
Removing the part saying that the container automatically fits to the size of the parent element because it's only true for the TypeScript version of the library.

Since the majority of Unovis users are using UI frameworks, they may be get confused by this.
  • Loading branch information
rokotyan authored and lee00678 committed Oct 23, 2024
1 parent 42b5f28 commit 58dd27a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,17 @@ export class VisSingleContainerComponent<Data = unknown, C extends ComponentCore
@ContentChild(VisTooltipComponent) tooltipComponent: VisTooltipComponent
@ContentChild(VisAnnotationsComponent) annotationsComponent: VisAnnotationsComponent

/** Width in pixels. By default, Container automatically fits to the size of the parent element. Default: `undefined`. */
/** Width in pixels or in CSS units.
* Percentage units `"%"` are not supported here. If you want to set `width` as a percentage, do it via `style` or `class`
* of the corresponding DOM element.
* Default: `undefined`
*/
@Input() width?: number
/** Height in pixels. By default, Container automatically fits to the size of the parent element. Default: `undefined`. */
/** Height in pixels or in CSS units.
* Percentage units `"%"` are not supported here. If you want to set `height` as a percentage, do it via `style` or `class`
* of the corresponding DOM element.
* Default: `undefined`
*/
@Input() height?: number

/** Margins. Default: `{ top: 0, bottom: 0, left: 0, right: 0 }` */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,17 @@ export class VisXYContainerComponent<Datum> implements AfterViewInit, AfterConte
@ContentChild(VisTooltipComponent) tooltipComponent: VisTooltipComponent
@ContentChild(VisAnnotationsComponent) annotationsComponent: VisAnnotationsComponent

/** Width in pixels. By default, Container automatically fits to the size of the parent element. Default: `undefined`. */
/** Width in pixels or in CSS units.
* Percentage units `"%"` are not supported here. If you want to set `width` as a percentage, do it via `style` or `class`
* of the corresponding DOM element.
* Default: `undefined`
*/
@Input() width?: number
/** Height in pixels. By default, Container automatically fits to the size of the parent element. Default: `undefined`. */
/** Height in pixels or in CSS units.
* Percentage units `"%"` are not supported here. If you want to set `height` as a percentage, do it via `style` or `class`
* of the corresponding DOM element.
* Default: `undefined`
*/
@Input() height?: number

/** Scale for X dimension, e.g. Scale.scaleLinear(). Default: `Scale.scaleLinear()` */
Expand Down
6 changes: 2 additions & 4 deletions packages/ts/src/core/container/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@ export interface ContainerConfigInterface {
/** Defines whether components should fit into the container or the container should expand to fit to the component's size. Default: `Sizing.Fit` */
sizing?: Sizing | string;
/** Width in pixels or in CSS units.
* Percentage units `"%"` are not supported here. If you want to set `width` as a percentage, do it via `style`
* Percentage units `"%"` are not supported here. If you want to set `width` as a percentage, do it via `style` or `class`
* of the corresponding DOM element.
* By default, Container automatically fits to the size of the parent element.
* Default: `undefined`
*/
width?: number | string;
/** Height in pixels or in CSS units.
* Percentage units `"%"` are not supported here. If you want to set `height` as a percentage, do it via `style`
* Percentage units `"%"` are not supported here. If you want to set `height` as a percentage, do it via `style` or `class`
* of the corresponding DOM element.
* By default, Container automatically fits to the size of the parent element.
* Default: `undefined`
*/
height?: number | string;
Expand Down

0 comments on commit 58dd27a

Please sign in to comment.