Skip to content

Commit 1f99fcf

Browse files
committed
yFiles for HTML 2.2.0.1 demos
1 parent ba01c5c commit 1f99fcf

16 files changed

+59
-30
lines changed

demos/README.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
</aside>
9494
<div class="content">
9595
<p id="general-intro" class="first-paragraph">
96-
The <a href="https://www.yworks.com/products/yfiles-for-html">yFiles for HTML 2.2</a> demos and tutorials are extensive sample applications that present the
96+
The <a href="https://www.yworks.com/products/yfiles-for-html">yFiles for HTML 2.2.0.1</a> demos and tutorials are extensive sample applications that present the
9797
features of the yFiles for HTML diagramming library.</p>
9898
<div id="tutorial-getting-started" class="hidden">
9999
<p>
@@ -148,8 +148,7 @@
148148
The complete source code of all of these samples is part of the yFiles for HTML package and available at <a
149149
href="https://github.com/yWorks/yfiles-for-html-demos">GitHub</a>.</p>
150150
<p>
151-
To execute a specific sample, click on its card below or open the <code>index.html</code> file in the sample's
152-
subdirectory.</p>
151+
To execute a specific sample, click on its card below.</p>
153152
<p id="online-notice">
154153
All of these demos are also hosted at the <a href="https://live.yworks.com/demos/" target="_blank">yFiles for HTML
155154
Online Demos page</a>.</p>

demos/demo-server/server.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ app.use((req, res, next) => {
5959
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept')
6060
res.header('Access-Control-Expose-Headers', 'X-Powered-By, X-yFiles-for-HTML-Demo-Server')
6161
res.header('X-yFiles-for-HTML-Demo-Server', 'true')
62+
if (req.path && /demos[\\/](?!node_modules).*\.js$/i.test(req.path)) {
63+
// disables caching
64+
res.header('Cache-Control', 'no-store')
65+
} else {
66+
res.header('Cache-Control', 'public, max-age=31536000')
67+
}
6268
next()
6369
})
6470

demos/loading/webpack/README.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<div class="content">
4949
<div class="content-centered">
5050
<p>
51-
This demo shows how to integrate the yFiles library in a <a href="https://webpack.js.org/">webpack 3</a> project.
51+
This demo shows how to integrate the yFiles library in a <a href="https://webpack.js.org/">webpack</a> project.
5252
</p>
5353
</div>
5454
<div class="content-centered" style="padding-bottom: 20px">

demos/loading/webpack/index.template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<h1 class="demo-sidebar-header">Description</h1>
5353
<div class="demo-sidebar-content">
5454
<p>
55-
This demo shows how to integrate the yFiles library in a <a href="https://webpack.js.org/" target="_blank">webpack 4</a> project.
55+
This demo shows how to integrate the yFiles library in a <a href="https://webpack.js.org/" target="_blank">webpack</a> project.
5656
Also note our <a href="https://github.com/yWorks/generator-yfiles-app" target="_blank">yeoman generator</a> that scaffolds yFiles
5757
projects with webpack 3 and webpack 4.
5858
</p>

demos/loading/webpack/webpack.config.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727
**
2828
***************************************************************************/
29+
const path = require('path')
2930
const CleanWebpackPlugin = require('clean-webpack-plugin')
3031
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
3132

@@ -71,7 +72,12 @@ const baseConfig = {
7172
},
7273
{
7374
test: /\.(png|svg|jpg|gif)$/,
74-
use: ['file-loader']
75+
use: {
76+
loader: 'file-loader',
77+
options: {
78+
publicPath: '.'
79+
}
80+
}
7581
}
7682
]
7783
},
@@ -81,7 +87,14 @@ const baseConfig = {
8187
filename: '[name].css',
8288
chunkFilename: '[id].css'
8389
})
84-
]
90+
],
91+
output: {
92+
filename: '[name].js',
93+
path: path.resolve(__dirname, 'dist'), // This is necessary when using the webpack dev server, so the bundles can
94+
// be loaded from dist/
95+
// https://webpack.js.org/configuration/output/#output-publicpath
96+
publicPath: 'dist'
97+
}
8598
}
8699

87100
module.exports = function(env, options) {

demos/loading/webpack/webpack.dev.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,5 @@ module.exports = {
6767
// add source maps for non-library code to enable convenient debugging
6868
exclude: ['yfiles.js']
6969
})
70-
],
71-
output: {
72-
filename: '[name].js',
73-
path: path.resolve(__dirname, 'dist'), // This is necessary when using the webpack dev server, so the bundles can
74-
// be loaded from dist/
75-
// https://webpack.js.org/configuration/output/#output-publicpath
76-
publicPath: 'dist'
77-
}
70+
]
7871
}

demos/loading/webpack/webpack.prod.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ module.exports = {
4949
})
5050
],
5151
output: {
52-
filename: '[name].[hash].js',
53-
path: path.resolve(__dirname, 'dist'),
54-
// This is necessary when using the webpack dev server, so the bundles can
55-
// be loaded from dist/
56-
// https://webpack.js.org/configuration/output/#output-publicpath
57-
publicPath: 'dist'
52+
filename: '[name].[hash].js'
5853
}
5954
}

demos/toolkit/react/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636

3737
<title>React Demo [yFiles for HTML]</title>
3838

39-
<link rel="stylesheet" href="../../node_modules/yfiles/yfiles.css">
40-
<link rel="stylesheet" href="../../resources/style/demo.css">
39+
<link rel="stylesheet" href="dist/app.css">
4140

4241
<script src="../../resources/filesystem-warning.js"></script>
4342
</head>

demos/toolkit/react/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@
1717
"yfiles": "^2.2.0"
1818
},
1919
"devDependencies": {
20-
"@yworks/optimizer": "^1.0.0",
2120
"@babel/cli": "^7.2.3",
2221
"@babel/core": "^7.4.0",
2322
"@babel/preset-env": "^7.4.2",
2423
"@babel/preset-react": "^7.0.0",
24+
"@yworks/optimizer": "^1.0.0",
2525
"babel-loader": "^8.0.5",
26+
"clean-webpack-plugin": "^2.0.1",
27+
"css-loader": "^2.1.1",
28+
"file-loader": "^3.0.1",
29+
"mini-css-extract-plugin": "^0.5.0",
2630
"webpack": "4.17.1",
2731
"webpack-cli": "3.1.0"
2832
}

demos/toolkit/react/src/app.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import 'yfiles/yfiles.css'
2+
import '../../../resources/style/demo.css'
3+
14
import React from 'react'
25
import ReactGraphComponent from './ReactGraphComponent.jsx'
36
import {DefaultGraph, ShapeNodeStyle} from 'yfiles'

0 commit comments

Comments
 (0)