ui5-lib-visualization
A UI5 control library that wraps the C3.jsC3.jsA D3-based JavaScript charting library. For the things here it is the charting engine a UI5 control library wraps, so a chart is declared in an XML view instead of configured in JavaScript. charting library as ui5.viz controls (Chart, ChartSeries, ChartDataPoint, ChartAxis, ChartLine, ChartArea and Color) declared in an XML view with data binding.
C3.js is configured from JavaScript; here a chart is declared in markup. ui5.viz.Chart extends sap.ui.core.Control and carries the configuration as properties and aggregations: series of ChartSeries with their ChartDataPoint children, xAxis, yAxis and y2Axis as ChartAxis with their labels, and lines, areas and colors for annotations and the series palette, each of them bindable to a model. Beyond C3.js's own line and area charts it adds annotation lines and areas on the chart grid, animated dashed lines, hatched areas, a convergence interval as a series type, and colour palettes set by default or per series. Where C3.js supports it the control updates without rerendering; the API documentation marks the properties that cannot, the legend position, the tooltip settings and the x-axis type among them. It enters a project either as a library path in the ui5 section of package.json for an OpenUI5 Starter Kit build, or by copying /dist into the project and registering ui5.viz in the sap-ui-bootstrap resourceroots.
Facts
Where it sits
Who is behind it
In the atlas: maintains 1@pulseshiftmaintainerMichael DellContributes to this
In the atlas: contributes to 1@dell-micJascha A. QuinternContributes to this
In the atlas: contributes to 1@fuchsvomwaldelenasrdContributes to this
In the atlas: contributes to 1@lenasrdmdel-cmContributes to this
In the atlas: contributes to 1@mdel-cmnwei-mcContributes to this
In the atlas: contributes to 1@nwei-mc5 contributors
Before choosing this
Conditions
PracticalFunctional boundary
On the second installation path there is no dependency to upgrade: the README states that for option b) all manual steps must be repeated every time the library version is updated.
What it declares
Every artifact
- Type
- Package
- Origin
- Independently maintained
As a package
- Where it runs
- does not say
- Distributed through
- does not say
Connections
Custom controls, wrappers and icon fonts packaged for reuse
Framework core: module loader, MVC runtime, binding, routing, theming
A D3-based JavaScript charting library. For the things here it is the charting engine a UI5 control library wraps, so a chart is declared in an XML view instead of configured in JavaScript.
Download
Install
npm add ui5-lib-visualizationDerived from the package name. No recipe recorded; the README has the configuration.
Where it sits in your app
Download
ui5.viz namespace; the library is registered in the application's own bootstrap.README
quoted from pulseshift/ui5-lib-visualization under MIT, readCustom OpenUI5 Data Vizualization library
This library provides an OpenUI5 API that acts as a wrapper for D3-based charting library C3.js. It offers a more detailed and attractive API design than sap.viz chart controls, which interacts harmoniously especially in XML Views in combination with data binding.
Usage
There are two options how to use the chart library in your UI5 project, depending of the project boilerplate you are using.
a) projects based on OpenUI5 Starter Kit
Add ui5-lib-visualization as dev dependency:
yarn add ui5-lib-visualization --dev
Update ui5 library config in your package.json:
"ui5" {
// ...
"library":[
{
"name": "ui5.viz",
"path": "node_modules/ui5-lib-visualization/dist/ui5/viz",
"prebuild": true
}
]
// ...
}
Finished, you can now use the library in your XML Views via e.g. xmlns:viz="ui5.viz" or in your controllers etc. If you want to upgrade the library, just use default yarn commands, the build process of the starter kit will handle the rest for you:
yarn upgrade ui5-lib-visualization
b) other UI5 projects (see also UI5Lab)
Download or clone this repository:
git clone git@github.com:pulseshift/ui5-lib-visualization.git
Copy the complete ready-to-use library from /dist to a target destination in your UI5 project (please keep the folder structure as is ui5/viz/).
Add the library to the sap-ui-bootstrap resourceroots in your index.html:
data-sap-ui-resourceroots="{ "ui5.viz": "pathToTargetDestination/ui5/viz" }"
Please be aware that for option b) all manual steps must be repeated every time when you want to update the library version. Because this variant is more susceptible to errors, we recommend to use the OpenUI5 Starter Kit.
Documentation
How to test real live samples please see section Example. Till then, please enjoy our first beta version of our automatcally created markdown API documentation:
- ui5.viz.Chart
- ui5.viz.ChartSeries
- ui5.viz.ChartDataPoint
- ui5.viz.ChartAxis
- ui5.viz.ChartAxisLabel
- ui5.viz.ChartLine
- ui5.viz.ChartArea
- ui5.viz.Color
Features
Hint: This overview is not yet complete. In the course of time we will point out all important new functions and add these points to the new demo app, too.
A brief overview of features, additional to C3.js line and area charts:
- Complete API coverage of properties and aggregations for a fully integrated feature set in XML views.
- If supported by C3.js, rerender will be avoided by the chart control to ensure smooth transitions in case of changes in the data.
- Support of chart annotations, like lines and areas in various designs.
- Support for special designs such as animated dashed lines or hatched areas.
- Convergence interval as a new display type of series.
- Simple color management by implementing color palettes or individual colors for specific series.
Example
To execute the demo, please follow the instructions described in section Development. At the time the demo is being refactored with the goal to provide you an SAP Explore like experience.
Here a basic sample of how to use the charts in an XML view:
<!-- ensure that the series data points and the x-axis labels have the exact same amount of entries -->
<Chart
width="{store>/width}"
height="{store>/height}"
showTooltip="{store>/showTooltip}"
groupedTooltip="{store>/groupedTooltip}"
showLegend="{store>/showLegend}"
xAxisType="Category"
series="{store>/series}">
<series>
<ChartSeries
type="{store>type}"
name="{store>name}"
data="{
path: 'store>dataPoints',
templateShareable: false
}">
<ChartDataPoint value="{store>}" />
</ChartSeries>
</series>
<xAxis>
<ChartAxis labels="{ path: 'store>/xAxis/labels'}">
<ChartAxisLabel value="{store>}" />
</ChartAxis>
</xAxis>
<yAxis>
<ChartAxis title="{store>/yAxis/title}" />
</yAxis>
</Chart>
Respective controller code:
// define series color palette with a preset based on material design colors
ui5.viz.setDefaultColorPalette(ui5.viz.ColorPalette.Material500)
// define model
const oModel = new JSONModel({
title: 'Chart',
width: '100%',
height: '300px',
showTooltip: true,
groupedTooltip: true,
showLegend: true,
xAxis: {
labels: ['April', 'May', 'June', 'July', 'August', 'September']
},
yAxis: {
title: 'Sightings in the woods 🌲'
},
series: [
{
name: 'Foxes 🦊',
dataPoints: [2, 5, 3, 5, 8, 9],
type: ui5.viz.ChartSeriesType.Spline
},
{
name: 'Bears 🐻',
dataPoints: [1, 2, 0, 2, 1, 3],
type: ui5.viz.ChartSeriesType.Spline
},
{
name: 'Deers 🦌',
dataPoints: [14, 20, 18, 23, 17, 18],
type: ui5.viz.ChartSeriesType.Spline
}
]
})
this.getView().setModel(oModel, 'store')
Development
Download or clone this repository:
git clone git@github.com:pulseshift/ui5-lib-visualization.git
Please ensure that you have installed node and yarn2 before you continue.
Install dependencies:
yarn
Start developing: Will build all resources start watcher task and start a HTTP server
yarn dev
The app should open in your browser automatically, otherwise open: http://localhost:3000/demo/index.html
Info: To get a more detailed logging, use yarn dev:verbose instead.
Distribution
Start distribution build:
Will create a dist directory in your project root.
yarn dist
This will build the app, test the code with linters and updates all docs automatically. Afterwards, the production app build can be tested by run yarn start:dist. The app should open in your browser automatically, otherwise open: http://localhost:3000/demo/index.html
Increase version number according to semantic versioning e.g.
yarn version patch
If the app build matches your requirements, upload your build to npm:
yarn npm publish
Contributing & Troubleshooting
Contributions, questions and comments are all welcome and encouraged.
Check our current issues or, if you have something in mind how to make it better, create your own issue. We would be happy to discuss how they can be solved.
Contributors
Thanks goes to these wonderful people (emoji key):
Lena Serdarusic 💻💡🤔 | Jascha A. Quintern 💻💬 | Michael Dell 🤔 |
|---|
License
This project is licensed under the MIT license. Copyright 2017 PulseShift GmbH
History
Notes
Update demo and improve stabilization.
Other 4
Notes
First BETA release of the UI5 visualization library
- finished and stabilized build process
- updated README
- marked demos as deprecated
- synced changes with OpenUI5 Starter-Kit
Others providing
Compare all 15 on the Custom controls and libraries page →- custom-controlscustom-controlsThirteen custom controls for abap2UI5, a signature pad and a scanner that reads several barcodes at once among them, each one an ABAP builder class with a single render( ) method and all of them shipped in a BSP of their own.community org, abapThirteen custom UI5 controls for abap2UI5 appsfrom ABAP
- @abap2ui5/embed-control@abap2ui5/embed-controlA UI5 custom control that runs an abap2UI5 app inside a host UI5 app, with the abap2UI5 frontend loaded from the backend the app talks to.community org, ui5UI5 custom control that runs an abap2UI5 app inside a host appfrom UI5
- ui5-cc-timerbuttonui5-cc-timerbuttonA UI5 control library with TimerButton, an sap.m.Button that delays becoming enabled or visible and shows other text or an icon in the meantime, with the delay set in milliseconds.independent, ui5UI5 control library with a button that delays enabling or showingfrom UI5
- ui5-control-generatorui5-control-generatorA command-line generator that writes UI5 custom controls, in JavaScript or TypeScript, from the html files in a project, with control logic and renderer split into two files by default.independent, ui5Command line generator of UI5 custom controls from htmlfrom UI5
- @marianfoo/ui5-cc-dayjs@marianfoo/ui5-cc-dayjsA UI5 custom control that writes a date to the page through Day.js, with the input format, the output format and any shift of days or months set as control properties.independent, ui5UI5 custom control formatting dates with Day.jsfrom UI5
- ui5-cc-pdfviewerui5-cc-pdfviewerA UI5 custom control that renders a PDF from a base64 data URI with pdfjs-dist, so a file picked in the browser can be shown before it has been uploaded anywhere and has a URL.independent, ui5UI5 custom control rendering a PDF from a base64 data URIfrom UI5
- openui5-passwordopenui5-passwordAn OpenUI5 input control of password type that checks the typed value against length and character-class rules set as properties, and scores password strength in a separate property.independent, ui5OpenUI5 password input with strength scoring and rulesfrom UI5
- openui5-touropenui5-tourAn OpenUI5 control library for a step-by-step guided tour inside a UI5 app, where each TourStep has a title, content, a target control from the view and a placement.independent, ui5OpenUI5 control library for guided app toursfrom UI5
- UI5XUI5XAn OpenUI5 and SAPUI5 library of eight composite controls under the ui5x namespace: skeleton placeholders and a container that swaps them for content, loading wrappers for the responsive and the grid table, an accordion, a copy button, a segmented input and a chat feed.independent, ui5UI5 library of eight composite controls under the ui5x namespacefrom UI5
- openui5-cameraopenui5-cameraA UI5 control that renders a live camera preview from the device's camera and hands the app the picture as a base64-encoded PNG when the user taps it.independent, ui5UI5 control for live camera preview and PNG capturefrom UI5
- ui5-cc-chartui5-cc-chartA UI5 custom control that wraps Chart.js to render a line chart from label and value records, installed as a plain npm dependency with ui5-tooling-modules in ui5.yaml.community org, ui5UI5 custom control wrapping Chart.js for line chartsfrom UI5
- ui5-cc-mdui5-cc-mdA UI5 custom control that renders Markdown, including GitHub-flavoured syntax, to HTML inside an XML view, taking its content from a string, a file path or a model binding.community org, ui5UI5 custom control rendering Markdown to HTMLfrom UI5
- ui5-fontawesome-libui5-fontawesome-libA UI5 library that adds Font Awesome's regular, solid and brand icon sets to the sap-icon:// namespace, addressable from a standard Icon control, for UI5 1.120.33 or later.community org, ui5UI5 library adding Font Awesome icon sets to sap-icon://from UI5
- openui5-paginatoropenui5-paginatorA UI5 custom control that pages through large data in a table, for backends that serve pages over REST rather than OData.independent, ui5A UI5 custom control that pages through large data in a table, for backends that serve pages over REST rather than OData.from UI5
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
History in the atlas
- First seen.
For your agent
- Ref
artifact:pulseshift-ui5-lib-visualization- JSON
- /artifacts/pulseshift-ui5-lib-visualization.json
- MCP
- Connecting an agent