2.4.3 • Published 3 months ago

@visa/visa-charts-data-table v2.4.3

Weekly downloads
-
License
SEE LICENCE IN LI...
Repository
github
Last release
3 months ago

@visa/visa-charts-data-table

An image depicting an example of the default data-table component

<data-table
  uniqueID={this.chartID}
  isCompact
  tableColumns={this.tableColumns}
  data={this.tableData}
  padding={this.padding}
  margin={this.margin}
  hideDataTable={this.accessibility.hideDataTableButton}
/>

# Installation Steps


  • Using npm

    $ npm i @visa/visa-charts-data-table
  • Using yarn

    $ yarn add @visa/visa-charts-data-table

# Props Documentation


# Data Table Props <>

The data-component expects to be utilized within a Visa Chart Component, we do some data preparation in each chart to try and map chart data into a structure that is meaningful for an accompanying data table. Properties for this component are documented below, but you should also refer to a Visa Chart Component to see detail on how this sub-component is leveraged.

NameTypeDefault Value(s)Description
marginobject (custom type)IBoxModelTypeExpects the margin property to be passed from a visa chart components chart. This prop is used to determine button placement, when visible.
paddingobject (custom type)IBoxModelTypeExpects the padding property to be passed from a visa chart components chart. This prop is used to determine button placement, when visible.
isCompactbooleanfalseSet to true by each visa chart component, renders a more compact version of the data table.
hideDataTablebooleanfalseIf true, hides the data table button (but it is still available to screen reader users).
uniqueIDstringundefinedID used to identify chart (must be unique per data table), helpful for validation messages. A string must be passed.
tableColumnsstring[]undefinedPopulates the column headers of the table, in order.
dataobject[]undefinedPopulates the content/rows of the table, data needs to be aligned to tableColumns provided.
unitTestbooleanfalseWhen set to true, adds testing attributes to the rendered data-table components for ease of selection during unit testing.

IBoxModelType Definition

NameTypeDefault Value(s)Description
topnumberheight * 0.01Sets the top margin/padding for the chart container.
bottomnumberheight * 0.01Sets the bottom margin/padding for the chart container.
leftnumberwidth * 0.01Sets the top margin/padding for the chart container.
rightnumberwidth * 0.01Sets the top margin/padding for the chart container.