@yanqirenshi/d3.wireframe 0.0.6 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/babel.config.js +10 -14
  2. package/dist/DataBackground.js +37 -0
  3. package/dist/DataFont.js +39 -0
  4. package/dist/DataPosition.js +39 -0
  5. package/dist/DataRectangle.js +37 -0
  6. package/dist/DataStroke.js +37 -0
  7. package/dist/Digestion.js +320 -0
  8. package/dist/Drawer.js +317 -0
  9. package/dist/Element.js +98 -0
  10. package/dist/ElementButton.js +128 -0
  11. package/dist/ElementDialog.js +112 -0
  12. package/dist/ElementFounder.js +116 -0
  13. package/dist/ElementFrame.js +112 -0
  14. package/dist/ElementIcon.js +83 -0
  15. package/dist/ElementImage.js +112 -0
  16. package/dist/ElementLabel.js +82 -0
  17. package/dist/ElementModal.js +93 -0
  18. package/dist/Rectum.js +161 -0
  19. package/dist/components/D3Wireframe.js +16 -0
  20. package/dist/index.js +16 -0
  21. package/jest.config.js +23 -17
  22. package/package.json +41 -35
  23. package/src/Element.js +1 -1
  24. package/src/ElementFounder.js +1 -0
  25. package/src/{D3Wireframe.js → Rectum.js} +115 -111
  26. package/src/components/D3Wireframe.js +9 -0
  27. package/src/index.js +9 -0
  28. package/tests/D3Wireframe.test.js +54 -7
  29. package/tests/d3-stub.js +4 -0
  30. package/docs/asset-manifest.json +0 -23
  31. package/docs/favicon.ico +0 -0
  32. package/docs/index.html +0 -1
  33. package/docs/logo192.png +0 -0
  34. package/docs/logo512.png +0 -0
  35. package/docs/manifest.json +0 -25
  36. package/docs/precache-manifest.5f1fad934ed0507dbc92de6788eff788.js +0 -30
  37. package/docs/robots.txt +0 -3
  38. package/docs/service-worker.js +0 -39
  39. package/docs/static/css/main.5f361e03.chunk.css +0 -2
  40. package/docs/static/css/main.5f361e03.chunk.css.map +0 -1
  41. package/docs/static/js/2.e2326255.chunk.js +0 -3
  42. package/docs/static/js/2.e2326255.chunk.js.LICENSE.txt +0 -32
  43. package/docs/static/js/2.e2326255.chunk.js.map +0 -1
  44. package/docs/static/js/main.7f51684e.chunk.js +0 -2
  45. package/docs/static/js/main.7f51684e.chunk.js.map +0 -1
  46. package/docs/static/js/runtime-main.0c5b98f9.js +0 -2
  47. package/docs/static/js/runtime-main.0c5b98f9.js.map +0 -1
  48. package/docs/static/media/logo.5d5d9eef.svg +0 -7
  49. package/documents/README.md +0 -68
  50. package/documents/package-lock.json +0 -13792
  51. package/documents/package.json +0 -34
  52. package/documents/public/favicon.ico +0 -0
  53. package/documents/public/index.html +0 -43
  54. package/documents/public/logo192.png +0 -0
  55. package/documents/public/logo512.png +0 -0
  56. package/documents/public/manifest.json +0 -25
  57. package/documents/public/robots.txt +0 -3
  58. package/documents/src/App.css +0 -38
  59. package/documents/src/App.js +0 -26
  60. package/documents/src/App.test.js +0 -9
  61. package/documents/src/index.css +0 -13
  62. package/documents/src/index.js +0 -17
  63. package/documents/src/logo.svg +0 -7
  64. package/documents/src/serviceWorker.js +0 -141
  65. package/documents/src/setupTests.js +0 -5
  66. package/example/README.md +0 -68
  67. package/example/package-lock.json +0 -14729
  68. package/example/package.json +0 -36
  69. package/example/public/favicon.ico +0 -0
  70. package/example/public/index.html +0 -43
  71. package/example/public/logo192.png +0 -0
  72. package/example/public/logo512.png +0 -0
  73. package/example/public/manifest.json +0 -25
  74. package/example/public/robots.txt +0 -3
  75. package/example/src/App.css +0 -38
  76. package/example/src/App.js +0 -14
  77. package/example/src/App.test.js +0 -9
  78. package/example/src/data/WIREFRAME_DATA.js +0 -11
  79. package/example/src/data/WIREFRAME_DATA_DIALOG.js +0 -65
  80. package/example/src/data/WIREFRAME_DATA_FRAME.js +0 -70
  81. package/example/src/data/WIREFRAME_DATA_MODAL.js +0 -10
  82. package/example/src/index.css +0 -13
  83. package/example/src/index.js +0 -17
  84. package/example/src/js/D3Wireframe.js +0 -111
  85. package/example/src/js/DataBackground.js +0 -23
  86. package/example/src/js/DataFont.js +0 -25
  87. package/example/src/js/DataPosition.js +0 -21
  88. package/example/src/js/DataRectangle.js +0 -20
  89. package/example/src/js/DataStroke.js +0 -23
  90. package/example/src/js/Digestion.js +0 -273
  91. package/example/src/js/Drawer.js +0 -270
  92. package/example/src/js/Element.js +0 -67
  93. package/example/src/js/ElementButton.js +0 -94
  94. package/example/src/js/ElementDialog.js +0 -77
  95. package/example/src/js/ElementFounder.js +0 -84
  96. package/example/src/js/ElementFrame.js +0 -77
  97. package/example/src/js/ElementIcon.js +0 -56
  98. package/example/src/js/ElementImage.js +0 -77
  99. package/example/src/js/ElementLabel.js +0 -51
  100. package/example/src/js/ElementModal.js +0 -65
  101. package/example/src/pages/ExampleGraph.js +0 -39
  102. package/example/src/pages/Explanation.js +0 -43
  103. package/example/src/pages/PageExample.js +0 -41
  104. package/example/src/serviceWorker.js +0 -141
  105. package/example/src/setupTests.js +0 -5
  106. package/index.js +0 -3
  107. package/riot.v3/index.html +0 -21
  108. package/riot.v3/index.js +0 -86
  109. package/riot.v3/scketch.js +0 -96
  110. package/riot.v3/wireframe.js +0 -11
@@ -1,41 +0,0 @@
1
- import React from 'react';
2
-
3
- import ExampleGraph from './ExampleGraph';
4
-
5
- import WIREFRAME_DATA from '../data/WIREFRAME_DATA.js';
6
-
7
- function PageExample () {
8
- const style = {
9
- root: {
10
- background: '#ffffff',
11
- width: '1024px',
12
- marginLeft: 'auto',
13
- marginRight: 'auto',
14
- },
15
- graph_area: {
16
- marginTop: '22px',
17
- marginBottom: '22px',
18
- },
19
- h1: {
20
- fontSize: '33px',
21
- fontWeight: 'bold',
22
- marginTop: '11px',
23
- },
24
- };
25
-
26
- return (
27
- <div style={style.root}>
28
-
29
- <div>
30
- <h1 style={style.h1}>Example of React</h1>
31
- </div>
32
-
33
- <div style={style.graph_area}>
34
- <ExampleGraph source={WIREFRAME_DATA} />
35
- </div>
36
-
37
- </div>
38
- );
39
- }
40
-
41
- export default PageExample;
@@ -1,141 +0,0 @@
1
- // This optional code is used to register a service worker.
2
- // register() is not called by default.
3
-
4
- // This lets the app load faster on subsequent visits in production, and gives
5
- // it offline capabilities. However, it also means that developers (and users)
6
- // will only see deployed updates on subsequent visits to a page, after all the
7
- // existing tabs open on the page have been closed, since previously cached
8
- // resources are updated in the background.
9
-
10
- // To learn more about the benefits of this model and instructions on how to
11
- // opt-in, read https://bit.ly/CRA-PWA
12
-
13
- const isLocalhost = Boolean(
14
- window.location.hostname === 'localhost' ||
15
- // [::1] is the IPv6 localhost address.
16
- window.location.hostname === '[::1]' ||
17
- // 127.0.0.0/8 are considered localhost for IPv4.
18
- window.location.hostname.match(
19
- /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
20
- )
21
- );
22
-
23
- export function register(config) {
24
- if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
25
- // The URL constructor is available in all browsers that support SW.
26
- const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
27
- if (publicUrl.origin !== window.location.origin) {
28
- // Our service worker won't work if PUBLIC_URL is on a different origin
29
- // from what our page is served on. This might happen if a CDN is used to
30
- // serve assets; see https://github.com/facebook/create-react-app/issues/2374
31
- return;
32
- }
33
-
34
- window.addEventListener('load', () => {
35
- const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
36
-
37
- if (isLocalhost) {
38
- // This is running on localhost. Let's check if a service worker still exists or not.
39
- checkValidServiceWorker(swUrl, config);
40
-
41
- // Add some additional logging to localhost, pointing developers to the
42
- // service worker/PWA documentation.
43
- navigator.serviceWorker.ready.then(() => {
44
- console.log(
45
- 'This web app is being served cache-first by a service ' +
46
- 'worker. To learn more, visit https://bit.ly/CRA-PWA'
47
- );
48
- });
49
- } else {
50
- // Is not localhost. Just register service worker
51
- registerValidSW(swUrl, config);
52
- }
53
- });
54
- }
55
- }
56
-
57
- function registerValidSW(swUrl, config) {
58
- navigator.serviceWorker
59
- .register(swUrl)
60
- .then(registration => {
61
- registration.onupdatefound = () => {
62
- const installingWorker = registration.installing;
63
- if (installingWorker == null) {
64
- return;
65
- }
66
- installingWorker.onstatechange = () => {
67
- if (installingWorker.state === 'installed') {
68
- if (navigator.serviceWorker.controller) {
69
- // At this point, the updated precached content has been fetched,
70
- // but the previous service worker will still serve the older
71
- // content until all client tabs are closed.
72
- console.log(
73
- 'New content is available and will be used when all ' +
74
- 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
75
- );
76
-
77
- // Execute callback
78
- if (config && config.onUpdate) {
79
- config.onUpdate(registration);
80
- }
81
- } else {
82
- // At this point, everything has been precached.
83
- // It's the perfect time to display a
84
- // "Content is cached for offline use." message.
85
- console.log('Content is cached for offline use.');
86
-
87
- // Execute callback
88
- if (config && config.onSuccess) {
89
- config.onSuccess(registration);
90
- }
91
- }
92
- }
93
- };
94
- };
95
- })
96
- .catch(error => {
97
- console.error('Error during service worker registration:', error);
98
- });
99
- }
100
-
101
- function checkValidServiceWorker(swUrl, config) {
102
- // Check if the service worker can be found. If it can't reload the page.
103
- fetch(swUrl, {
104
- headers: { 'Service-Worker': 'script' },
105
- })
106
- .then(response => {
107
- // Ensure service worker exists, and that we really are getting a JS file.
108
- const contentType = response.headers.get('content-type');
109
- if (
110
- response.status === 404 ||
111
- (contentType != null && contentType.indexOf('javascript') === -1)
112
- ) {
113
- // No service worker found. Probably a different app. Reload the page.
114
- navigator.serviceWorker.ready.then(registration => {
115
- registration.unregister().then(() => {
116
- window.location.reload();
117
- });
118
- });
119
- } else {
120
- // Service worker found. Proceed as normal.
121
- registerValidSW(swUrl, config);
122
- }
123
- })
124
- .catch(() => {
125
- console.log(
126
- 'No internet connection found. App is running in offline mode.'
127
- );
128
- });
129
- }
130
-
131
- export function unregister() {
132
- if ('serviceWorker' in navigator) {
133
- navigator.serviceWorker.ready
134
- .then(registration => {
135
- registration.unregister();
136
- })
137
- .catch(error => {
138
- console.error(error.message);
139
- });
140
- }
141
- }
@@ -1,5 +0,0 @@
1
- // jest-dom adds custom jest matchers for asserting on DOM nodes.
2
- // allows you to do things like:
3
- // expect(element).toHaveTextContent(/react/i)
4
- // learn more: https://github.com/testing-library/jest-dom
5
- import '@testing-library/jest-dom/extend-expect';
package/index.js DELETED
@@ -1,3 +0,0 @@
1
- import D3Wireframe from './src/D3Wireframe.js';
2
-
3
- export default D3Wireframe;
@@ -1,21 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title>D3.Wireframe</title>
7
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css">
8
- <script defer src="https://use.fontawesome.com/releases/v5.1.0/js/all.js"></script>
9
-
10
- <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/5.5.0/d3.min.js"></script>
11
- <script src="https://gl.githack.com/js-libs/d3.svg/raw/master/src/d3-svg.js"></script>
12
-
13
- <script src="./scketch.js"></script>
14
- <script src="./wireframe.js"></script>
15
- </head>
16
- <body>
17
- <svg id="scketchbook"></svg>
18
-
19
- <script src="./index.js"></script>
20
- </body>
21
- </html>
package/riot.v3/index.js DELETED
@@ -1,86 +0,0 @@
1
- /**
2
- * Sample draw Rectangle
3
- */
4
-
5
- function draw (rects) {
6
- let d3svg = makeD3Svg();
7
- let svg = d3svg.Svg();
8
- let forground = svg.selectAll('g.base.forground');
9
-
10
- forground.selectAll('rect.sample')
11
- .data(rects, (d) => { return d._id; })
12
- .enter()
13
- .append('rect')
14
- .attr('class', 'sample')
15
- .attr('x', (d) => { return d.x;})
16
- .attr('y', (d) => { return d.y;})
17
- .attr('width', (d) => { return d.size.w;})
18
- .attr('height', (d) => { return d.size.h;})
19
- .attr('rx', (d) => { return d.r;})
20
- .attr('ry', (d) => { return d.r;})
21
- .attr('fill', (d) => {
22
- console.log(d.background.color);
23
- return d.background.color;
24
- })
25
- .attr('stroke', (d) => { return d.stroke.color; })
26
- .attr('stroke-width', (d) => { return d.stroke.width; });
27
-
28
- }
29
-
30
-
31
- let rects = [
32
- // 対角線あり 四角
33
- {
34
- x: Math.round( Math.random()*1000 ) - 500,
35
- y: Math.round( Math.random()*1000 ) - 500,
36
- size: { w: 222, h: 333 },
37
- r: 0,
38
- stroke: {
39
- color: '#333333',
40
- width: 1
41
- },
42
- background: {
43
- color: '#fff'
44
- },
45
- // 対角線
46
- diagonal : {
47
- color: '#333333',
48
- width: 1
49
- }
50
- },
51
- // 対角線なし 四角
52
- {
53
- x: Math.round( Math.random()*1000 ) - 500,
54
- y: Math.round( Math.random()*1000 ) - 500,
55
- size: { w: 222, h: 333 },
56
- r: 0,
57
- stroke: {
58
- color: '#333333',
59
- width: 1
60
- },
61
- background: {
62
- color: '#fff'
63
- },
64
- // 対角線
65
- diagonal : null
66
- },
67
- // 対角線なし 四角 角丸
68
- {
69
- x: Math.round( Math.random()*1000 ) - 500,
70
- y: Math.round( Math.random()*1000 ) - 500,
71
- size: { w: 222, h: 333 },
72
- r: 8,
73
- stroke: {
74
- color: '#333333',
75
- width: 1
76
- },
77
- background: {
78
- color: '#fff'
79
- },
80
- // 対角線
81
- diagonal : null
82
- }
83
- ];
84
-
85
-
86
- draw(rects);
@@ -1,96 +0,0 @@
1
- function makeBases (d3svg) {
2
- let svg = d3svg.Svg();
3
-
4
- let base = [
5
- { _id: -10, code: 'background' },
6
- { _id: -15, code: 'forground' },
7
- ];
8
-
9
- svg.selectAll('g.base')
10
- .data(base, (d) => { return d._id; })
11
- .enter()
12
- .append('g')
13
- .attr('class', (d) => {
14
- return 'base ' + d.code;
15
- });
16
- }
17
- function drawBackground (d3svg) {
18
- let length = 8800;
19
- let start = length * -1;
20
- let end = length;
21
- let x_data = [];
22
- let y_data = [];
23
- let _id = 100;
24
-
25
- let axis = [
26
- { _id: _id++, x1: start, x2: end, y1: 0, y2: 0},
27
- { _id: _id++, x1: 0, x2: 0, y1: start, y2: end},
28
- ];
29
-
30
- for (var i=start ; i < end ; i+=100)
31
- x_data.push({ _id: _id++,
32
- x1:i,
33
- y1:start,
34
- x2:i,
35
- y2: end});
36
-
37
- for (var i=start ; i < end ; i+=100)
38
- y_data.push({ _id: _id++,
39
- x1:start,
40
- y1:i,
41
- x2:end,
42
- y2: i});
43
-
44
- let data = [].concat(x_data).concat(y_data);
45
-
46
- let svg = d3svg.Svg();
47
- let background = svg.selectAll('g.base.background');
48
-
49
- background.selectAll('line.grid')
50
- .data(data, (d) => { return d._id; })
51
- .enter()
52
- .append('line')
53
- .attr('class', 'grid')
54
- .attr('x1', (d) => { return d.x1;})
55
- .attr('y1', (d) => { return d.y1;})
56
- .attr('x2', (d) => { return d.x2;})
57
- .attr('y2', (d) => { return d.y2;})
58
- .attr('stroke', '#888888')
59
- .attr('stroke-width', 0.3)
60
- .attr('stroke-dasharray', 3);
61
-
62
- background.selectAll('line.axis')
63
- .data(axis, (d) => { return d._id; })
64
- .enter()
65
- .append('line')
66
- .attr('class', 'axis')
67
- .attr('x1', (d) => { return d.x1;})
68
- .attr('y1', (d) => { return d.y1;})
69
- .attr('x2', (d) => { return d.x2;})
70
- .attr('y2', (d) => { return d.y2;})
71
- .attr('stroke', '#333333')
72
- .attr('stroke-width', 3);
73
- }
74
- function makeD3Svg () {
75
- let w = window.innerWidth;
76
- let h = window.innerHeight;
77
-
78
- let svg_tag = document.getElementById('scketchbook');
79
- svg_tag.setAttribute('height',h);
80
- svg_tag.setAttribute('width',w);
81
-
82
- let d3svg = new D3Svg({
83
- d3: d3,
84
- svg: d3.select("#scketchbook"),
85
- x: 0,
86
- y: 0,
87
- w: w,
88
- h: h,
89
- scale: 1
90
- });
91
-
92
- makeBases(d3svg);
93
- drawBackground(d3svg);
94
-
95
- return d3svg;
96
- }
@@ -1,11 +0,0 @@
1
- class image {}
2
- class combobox {}
3
- class input {}
4
- class textarea {}
5
- class button {}
6
- class section {}
7
-
8
- class label {}
9
- class Paragraph {}
10
-
11
- class MarkNumber {}