Skip to content

Commit 8777373

Browse files
committed
Merge branch 'feature/update_build_process'
2 parents f39d17c + 0dc8651 commit 8777373

File tree

136 files changed

+34729
-46687
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+34729
-46687
lines changed

.eslintcache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/Chart.js":{"size":99631,"mtime":1519567138149,"hashOfConfig":"1083ajv","results":{"filePath":"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/Chart.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/ChartArea.js":{"size":7044,"mtime":1519566862252,"hashOfConfig":"1083ajv","results":{"filePath":"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/ChartArea.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/ChartAxis.js":{"size":14513,"mtime":1519566886373,"hashOfConfig":"1083ajv","results":{"filePath":"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/ChartAxis.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/ChartAxisLabel.js":{"size":5761,"mtime":1519566914862,"hashOfConfig":"1083ajv","results":{"filePath":"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/ChartAxisLabel.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/ChartDataPoint.js":{"size":8194,"mtime":1519566944144,"hashOfConfig":"1083ajv","results":{"filePath":"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/ChartDataPoint.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/ChartLine.js":{"size":8129,"mtime":1519566965232,"hashOfConfig":"1083ajv","results":{"filePath":"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/ChartLine.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/ChartSeries.js":{"size":16381,"mtime":1519566996708,"hashOfConfig":"1083ajv","results":{"filePath":"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/ChartSeries.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/Color.js":{"size":3910,"mtime":1519567012968,"hashOfConfig":"1083ajv","results":{"filePath":"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/Color.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}},"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/library.js":{"size":6537,"mtime":1519567043428,"hashOfConfig":"1083ajv","results":{"filePath":"/Users/Jascha/GitHub/ui5-lib-visualization/src/ui5/viz/library.js","messages":[],"errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0}}}

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# /node_modules/* and /bower_components/* ignored by default
2+
3+
# Ignore ui5 dependencies
4+
src/ui5/viz/libs/*

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module.exports = {
3636
less: false,
3737
c3: false,
3838
d3: false,
39-
_: false
39+
lodashDebounce: false,
40+
lodashIsequal: false
4041
}
4142
}

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
/.vscode/
99

1010
### Build Process ###
11-
/dist/
1211
/ui5/
1312
/.tmp/
1413
/.maps/
1514
/.download/
16-
/src/vendor-beta/*
1715

16+
### Dist Files ###
17+
/dist/demo/
18+
/dist/ui5/viz/themes/**/*.less
1819

1920
### Node ###
2021
node_modules/

.settings/.jsdtscope

Lines changed: 0 additions & 7 deletions
This file was deleted.

.settings/org.eclipse.wst.jsdt.ui.superType.container

Lines changed: 0 additions & 1 deletion
This file was deleted.

.settings/org.eclipse.wst.jsdt.ui.superType.name

Lines changed: 0 additions & 1 deletion
This file was deleted.

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ before_script:
2525
# no test task exist, yet, theirfore we test some other tasks (e.g. build)
2626
script:
2727
- yarn docs
28+
- yarn test
2829
- yarn build:verbose

.vscode/settings.json

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 113 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,35 @@
55

66
This library provides an OpenUI5 API that acts as a wrapper for D3-based charting library [C3.js](http://c3js.org/). 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.
77

8+
> Furthermore, this project is also a Boilerplate for all UI5 control libraries that rely completely on Open Source and uses 100% internally the same Gulp based build script as our [OpenUI5 Starter Kit](https://github.com/pulseshift/openui5-gulp-starter-kit). One build script to **rule them all**, I mean, how cool is that? Probably pretty cool, at least as long as we haven't found an alternative with Webpack yet. So take a look at our Starter Kit to learn more about the features and functionality of the build process.
9+
810
## Usage
911

10-
tbd: how to use this lib in your project...
12+
This npm module already provides all content to use the library immediately: the folder `/src` contains all source files (written in LESS and ES6/ES7), in the folder `/dist` you will find the library, completely ready for use. Now there are two ways to use the library in your npm project:
13+
14+
1. You can go the way recommended by [UI5Lab](https://github.com/UI5Lab/UI5Lab-library-simple) which ends up with copying the resources and files from the cloned npm project to your project either manually or via a custom script. We do not recommend that you go this way, because changes to the library must always be copied manually and this variant is more susceptible to errors.
15+
16+
1. The way we recommend you is to use our OpenUI5 Starter-Kit for embedding. The prerequisite is that your project uses the build process of the starter kit (see instructions [here](https://github.com/pulseshift/openui5-gulp-starter-kit)). All you have to do then is:
17+
* Download our library as dev-dependency with `yarn add ui5-lib-visualization --dev`.
18+
* Add the library to your UI5 build settings in the `package. json`_\*_.
19+
* Finished, you can now integrate the library into your XML Views via `xmlns: viz="ui5. viz"` or use it in your controllers etc..
20+
21+
_\*snipped to include the library via ui5 config in `package. json`:_
22+
23+
```json
24+
"library":[
25+
{
26+
"name": "ui5. viz",
27+
"path": "node_modules/ui5-lib-visualization/dist/ui5/viz",
28+
"prebuild": true
29+
}
30+
]
31+
```
1132

1233
### Documentation
1334

14-
Real live samples are beeing published, soon. Till then, please enjoy our first `beta` version of our automatcally created markdown API documentation:
35+
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:
36+
1537
* [ui5.viz.Chart](./docs/Chart.md)
1638
* [ui5.viz.ChartSeries](./docs/ChartSeries.md)
1739
* [ui5.viz.ChartDataPoint](./docs/ChartDataPoint.md)
@@ -23,41 +45,120 @@ Real live samples are beeing published, soon. Till then, please enjoy our first
2345

2446
### Features
2547

26-
tbd: brief overview about the main features...
48+
_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._
49+
50+
A brief overview of features, additional to C3.js line and area charts:
2751

2852
### Example
2953

54+
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 explored like experience.
55+
56+
Here a basic sample of how to use the charts in an XML view:
57+
58+
```xml
59+
<!-- ensure that the series data points and the x-axis labels have the exact same amount of entries -->
60+
<Chart
61+
width="{store>/width}"
62+
height="{store>/height}"
63+
showTooltip="{store>/showTooltip}"
64+
groupedTooltip="{store>/groupedTooltip}"
65+
showLegend="{store>/showLegend}"
66+
xAxisType="Indexed"
67+
series="{store>/series}">
68+
<series>
69+
<ChartSeries
70+
type="{store>type}"
71+
name=" {store>name}"
72+
data="{
73+
path: 'store>dataPoints',
74+
templateShareable: false
75+
}">
76+
<data>
77+
<ChartDataPoint value="{store>}" />
78+
</data>
79+
</ChartSeries>
80+
</series>
81+
<xAxis>
82+
<ChartAxis labels="{ path: 'store>/xAxis/0/labels'}">
83+
<labels>
84+
<ChartAxisLabel value="{store>}" />
85+
</labels>
86+
</ChartAxis>
87+
</xAxis>
88+
<yAxis>
89+
<ChartAxis title="{store>/yAxis/0/title}" />
90+
</yAxis>
91+
</Chart>
92+
```
93+
94+
Respective controller code:
95+
3096
```js
31-
// samples are coming soon
97+
// define series color palette with a preset based on material design colors
98+
ui5.viz.setDefaultColorPalette(ui5.viz.ColorPalette.Material500)
99+
100+
// define model
101+
const oModel = new JSONModel({
102+
title: 'Area line chart',
103+
width: '100%',
104+
height: '300px',
105+
showTooltip: true,
106+
groupedTooltip: true,
107+
showLegend: true,
108+
xAxis: [
109+
{
110+
labels: ['April', 'May', 'June', 'July', 'August', 'September']
111+
}
112+
],
113+
yAxis: [
114+
{
115+
title: 'Sightings in the woods 🍃'
116+
}
117+
],
118+
series: [
119+
{
120+
name: 'Foxes 🦊',
121+
dataPoints: [2, 5, 3, 5, 8, 9],
122+
type: 'area'
123+
}
124+
]
125+
})
126+
127+
this.getView().setModel(oModel, 'store')
32128
```
33129

34130
## Development
35131

36132
[Download](https://github.com/pulseshift/ui5-lib-visualization/archive/master.zip) or clone this repository:
133+
37134
```
38135
git clone git@github.com:pulseshift/ui5-lib-visualization.git
39136
```
40137

41138
Please ensure that you have installed [node](https://nodejs.org/en/) and [yarn](https://yarnpkg.com/en/docs/install) before you continue.
42139

43140
Install dependencies:
141+
44142
```
45143
yarn
46144
```
145+
47146
Start developing:
48147
_Will build all resources start watcher task and start a HTTP server_
148+
49149
```
50150
yarn start
51151
```
52152

53-
The app should open in your browser automatically, otherwise open: `http://localhost:3000`
153+
The app should open in your browser automatically, otherwise open: `http://localhost:3000/demo/index.html`
54154

55155
Info: To get a more detailed logging, use `yarn start:verbose` instead.
56156

57157
## Distribution
58158

59159
Start build:
60160
_Will create a `dist` directory in your project root._
161+
61162
```
62163
yarn build
63164
```
@@ -72,17 +173,15 @@ Contributions, questions and comments are all welcome and encouraged.
72173

73174
Check our [current issues](https://github.com/pulseshift/ui5-lib-visualization/issues) or, if you have something in mind how to make it better, [create your own issue](https://github.com/pulseshift/ui5-lib-visualization/issues/new). We would be happy to discuss how they can be solved.
74175

75-
### Outlook
176+
### Contributors
177+
178+
Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
179+
180+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
76181

77-
Here is a brief overview on what we are working on right know and what will follow, soon. We are interested to hear your opinion on what should follow next.
182+
| [<img src="https://avatars1.githubusercontent.com/u/28702172?s=460&v=4" width="100px;"/><br /><sub><b>Lena Serdarusic</b></sub>](https://github.com/lenasrd)<br />[💻](https://github.com/pulseshift/ui5-lib-visualization/commits?author=lenasrd 'Code')💡🤔 | [<img src="https://avatars2.githubusercontent.com/u/8706643?s=460&v=4" width="100px;"/><br /><sub><b>Jascha A. Quintern</b></sub>](http://jascha-quintern.de)<br />[💻](https://github.com/pulseshift/ui5-lib-visualization/commits?author=fuchsvomwalde 'Code')💬 |
183+
| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
78184

79-
Current todos/issues/idea backlog (unordered):
80-
- Add check to setKey of ChartSeries and disallow "x" as key (because it is preserved)
81-
- Optional: update data types in library.js and align values with keys
82-
- ChartArea attribute "style" is not working with data binding, yet
83-
- Add (real) full-screen mode to Chart control
84-
- Y-axis label is corupting Y-axis display, if value is 0
85-
- Missing build step: create library.css for all themes
86185

87186
### License
88187

0 commit comments

Comments
 (0)