Skip to content

Commit

Permalink
Tools: Added initial demos setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
bre1470 committed Jul 5, 2024
1 parent 0cad61a commit bd75391
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 1 deletion.
14 changes: 14 additions & 0 deletions demos/stock/demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="https://code.highcharts.com/dashboards/2.2.0/css/dashboards.css" />
<script src="https://code.highcharts.com/dashboards/2.2.0/dashboards.src.js"></script>
<script src="../../code/morningstar-connectors.src.js"></script>
<title>Highcharts Stock Demo - Morningstar Connectors Demos</title>
</head>
<body>
<div id="container"></div>
<script src="./demo.js"></script>
</body>
</html>
23 changes: 23 additions & 0 deletions demos/stock/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const MCS = Dashboards.MorningstarConnectors.Shared;
const api = new MCS.MorningstarAPI();

(async () => {
const environment = await (await fetch('/tmp/Environment.json')).json();

Dashboards.board('container', {
dataPool: {
connectors: [{
type: 'MorningstarTimeSeries',
options: {
api: {
authentication: {
password: environment.values[2].value,
username: environment.values[1].value
}
}
}
}]
}
});

})();
18 changes: 18 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Morningstar Connectors Demos - Highcharts Dashboards</title>
</head>
<body>
<div>
<h1>Morningstar Connectors Demos</h1>
<ul>
<li><a href="demos/dashboards/demo.html">Highcharts Dashboards Demo</a></li>
<li><a href="demos/data-grid/demo.html">Highcharts DataGrid Demo</a></li>
<li><a href="demos/highcharts/demo.html">Highcharts Demo</a></li>
<li><a href="demos/stock/demo.html">Highcharts Stock Demo</a></li>
</ul>
</div>
</body>
</html>
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"build:prepare": "mkdir -p build/package/ && cp -R dist lib LICENSE.md README.md build/package/ && cp package-build.json build/package/package.json",
"build:pack": "npm pack build/package/ --pack-destination build/",
"build:cleanup": "rm -rf build/package/",
"demos": "npm run webpack && npm run demos:server",
"demos:server": "python3 -m http.server --bind localhost 8123",
"prepare": "husky install",
"scripts": "tsc -p src/",
"test": "npm run test:prepare",
Expand Down
2 changes: 1 addition & 1 deletion src/TODOS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
To-Dos
======

* Implement `MorningstarConnector` with automated autorization.
* Implement `Playbook.getAuthenticationOptionsFromEnvironment`.

* Implement `MorningstarConverter` with JSON processing and validation.

Expand Down

0 comments on commit bd75391

Please sign in to comment.