Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions examples/anychart-bindable.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>maidr + AnyChart Example</title>
<style>
body {
font-family: sans-serif;
margin: 2rem;
}
#container {
width: 600px;
height: 400px;
margin-bottom: 1rem;
}
p { max-width: 600px; }
</style>
<!--
1. Load AnyChart (CDN).
Replace the version / URL with your own if you have a licence.
-->
<script src="https://cdn.anychart.com/releases/8.13.0/js/anychart-base.min.js"></script>

<!-- 2. Load the core MAIDR runtime (handles maidr-data attribute). -->
<script src="../dist/maidr.js"></script>

<!-- 3. Load the MAIDR AnyChart adapter. -->
<script type="module">
import { bindAnyChart } from '../dist/anychart.mjs';

// Wait for AnyChart and the DOM to be ready.
document.addEventListener('DOMContentLoaded', () => {
// Create an AnyChart bar chart.
const chart = anychart.bar([
['Sat', 87],
['Sun', 76],
['Thur', 62],
['Fri', 19],
]);

chart.title('The Number of Tips by Day');
chart.xAxis().title('Day');
chart.yAxis().title('Count');
chart.container('container');
chart.draw();

// Bind the chart to MAIDR – extracts data, sets maidr-data, and
// dispatches the initialisation event.
bindAnyChart(chart, {
id: 'anychart-bar',
title: 'The Number of Tips by Day',
axes: { x: 'Day', y: 'Count' },
});
});
</script>
</head>
<body>
<h1>maidr + AnyChart Integration</h1>
<p>
This example shows how to use the <code>maidr/anychart</code> adapter
to make an AnyChart bar chart accessible via audio sonification, text
descriptions, braille output, and keyboard navigation.
</p>
<div id="container"></div>
</body>
</html>
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,22 @@
"types": "./dist/react.d.mts",
"import": "./dist/react.mjs",
"default": "./dist/react.mjs"
},
"./anychart": {
"types": "./dist/anychart.d.mts",
"import": "./dist/anychart.mjs",
"default": "./dist/anychart.mjs"
}
},
"main": "dist/maidr.js",
"files": [
"dist"
],
"scripts": {
"build": "vite build && vite build --config vite.react.config.ts",
"build": "vite build && vite build --config vite.react.config.ts && vite build --config vite.anychart.config.ts",
"build:script": "vite build",
"build:react": "vite build --config vite.react.config.ts",
"build:anychart": "vite build --config vite.anychart.config.ts",
"prepublishOnly": "npm run build",
"prepare": "husky",
"commitlint": "commitlint --from=HEAD~1 --to=HEAD",
Expand Down
Loading