Skip to content

Commit dfe4f6d

Browse files
committed
Add chart files
1 parent 7ad7a46 commit dfe4f6d

22 files changed

Lines changed: 39078 additions & 96 deletions

D3 Chart.code-workspace

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "."
5+
}
6+
]
7+
}

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,12 @@ npm install react-native-d3-chart
1010

1111
## Usage
1212

13+
TODO
1314

1415
```js
15-
import { D3ChartView } from "react-native-d3-chart";
16-
17-
// ...
18-
19-
<D3ChartView color="tomato" />
16+
import Chart from 'react-native-d3-chart';
2017
```
2118

22-
2319
## Contributing
2420

2521
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def supportsNamespace() {
4242

4343
android {
4444
if (supportsNamespace()) {
45-
namespace "com.d3chart"
45+
namespace "dev.mitigate.d3chart"
4646

4747
sourceSets {
4848
main {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.d3chart">
2+
package="dev.mitigate.d3chart">
33
</manifest>

android/src/main/assets/chart.html

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8" />
3+
<meta
4+
name="viewport"
5+
content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
6+
<head title="char"></head>
7+
8+
<!-- Load d3.js -->
9+
<script src="d3.v7.min.js"></script>
10+
<script src="d3-time-format.js"></script>
11+
12+
<style>
13+
body {
14+
-webkit-touch-callout: none;
15+
-webkit-user-select: none;
16+
-khtml-user-select: none;
17+
-moz-user-select: none;
18+
-ms-user-select: none;
19+
user-select: none;
20+
margin: 0;
21+
}
22+
#my_dataviz {
23+
position: relative;
24+
font-size: 0;
25+
}
26+
#highlight_holder {
27+
display: flex;
28+
flex-direction: row;
29+
align-items: center;
30+
padding: 10px 20px;
31+
}
32+
.row_holder {
33+
gap: 4px;
34+
display: flex;
35+
flex-direction: column;
36+
}
37+
.row_holder > span {
38+
font-weight: 700;
39+
font-size: 17px;
40+
height: 20px;
41+
}
42+
#values_holder {
43+
margin-left: 10px;
44+
margin-right: auto;
45+
}
46+
#timeholder {
47+
padding: 5px;
48+
margin-top: auto;
49+
border-radius: 4px;
50+
flex-direction: row;
51+
background: #17bebb;
52+
}
53+
#timeholder > span {
54+
height: 14px;
55+
font-size: 12px;
56+
color: white;
57+
font-style: normal;
58+
line-height: normal;
59+
}
60+
#timeholder > #time {
61+
font-weight: 700;
62+
margin-left: 8px;
63+
}
64+
</style>
65+
66+
<!-- Create a div where the graph will take place -->
67+
<body>
68+
<div id="my_dataviz">
69+
<div id="highlight_holder">
70+
<div id="labels_holder" class="row_holder"></div>
71+
<div id="values_holder" class="row_holder"></div>
72+
<div id="timeholder">
73+
<span id="date"></span>
74+
<span id="time"></span>
75+
</div>
76+
</div>
77+
</div>
78+
</body>
79+
<script>
80+
window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'READY' }))
81+
</script>

0 commit comments

Comments
 (0)