Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lis histogram element #386

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c5afc12
First pass at a simple d3 histogram litelement. #224
ctcncgr Apr 10, 2024
af4908b
reduce required logic. #224
ctcncgr Apr 11, 2024
bdc66aa
add labels to axis. #224
ctcncgr Apr 16, 2024
39d91f2
add labels to axis. #224
ctcncgr Apr 16, 2024
a32abf0
add labels to axis. add fill to override none in d3 v4. #224
ctcncgr Apr 16, 2024
a28041c
add labels to axis. add fill to override none in d3 v4. #224
ctcncgr Apr 16, 2024
e693130
add labels to axis. add fill to override none in d3 v4. #224
ctcncgr Apr 16, 2024
ad54ce8
working histogram. need to fix y axis rendering issue. #224
ctcncgr Apr 16, 2024
89c24cd
add padding to svg width and height to fix axis overflow issues. #224
ctcncgr Apr 17, 2024
9361bb7
add padding to svg width and height to fix axis overflow issues. #224
ctcncgr Apr 17, 2024
e13975f
render axis ticks and values. add padding. #224
ctcncgr Apr 17, 2024
5fc55d0
working axis with labels. #224
ctcncgr Apr 17, 2024
4caf0d4
updated with xlabel and ylabel properties to set axis labels. #224
ctcncgr Apr 17, 2024
9d12255
updated with settable axis labels and working example in dev/core. #224
ctcncgr Apr 17, 2024
3d348c3
added configurable width and height for the SVG container. #224
ctcncgr Apr 17, 2024
30d1eb3
add mouse on hover for each rectangle to display x and y values and a…
ctcncgr Apr 17, 2024
105f1b8
orientation property can now be set to vertical. horizontal by defaul…
ctcncgr Apr 18, 2024
c8eff5d
added dynamic padding based on maxLabelLength for the ordinal axis. #224
ctcncgr Apr 30, 2024
ceb1368
remove useless comments and fix formatting. #224
ctcncgr Apr 30, 2024
c6ef552
added usage and example. #224
ctcncgr Apr 30, 2024
1153cc4
Filled out page text for example using simple-table and histogram. #224
ctcncgr Apr 30, 2024
1fb7530
better example formatting. #224
ctcncgr Apr 30, 2024
c10b58a
add lis-histogram-data-model to be imported by lis-histogram-element.…
ctcncgr May 1, 2024
39d6ebb
regenerated docs. #224
ctcncgr May 1, 2024
471a931
fix some things for PR #386 issue #224.
ctcncgr May 14, 2024
1bd11b3
removed private properties. #386
ctcncgr May 14, 2024
fb66cc2
update lis-histogram-element.html and move to viz from core. #386
ctcncgr May 14, 2024
5a1bf23
remove lis-histogram-element from core and add to viz. #386
ctcncgr May 14, 2024
6c8967d
change examples based on comments from #386
ctcncgr May 14, 2024
17c9952
remove histogram data model from models and add export to lis-histogr…
ctcncgr May 14, 2024
0717a4c
add entry for viz components in typedoc.json. #386
ctcncgr May 14, 2024
47f99c2
regenerate docs. #386
ctcncgr May 14, 2024
8916fe4
fix issue with example formatting missing some * #386
ctcncgr May 15, 2024
ff730e0
removed lis-resize-observer-controller as it is no longer used. updat…
ctcncgr May 15, 2024
5c6bd91
update example to fix docs for new axis labels. #386
ctcncgr May 15, 2024
9aa136a
regenerate docs. #386
ctcncgr May 15, 2024
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
63 changes: 63 additions & 0 deletions dev/viz/lis-histogram-element.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!DOCTYPE html>

<html>

<head>
<meta charset="utf-8" />
<title>LIS Web-Components - &lt;lis-histogram-element&gt;</title>
<!-- CSS framework -->
<link rel="stylesheet" type="text/css" href="../../node_modules/uikit/dist/css/uikit.min.css">
<script src="../../node_modules/uikit/dist/js/uikit.min.js"></script>
<!-- web components polyfills -->
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script src="../../node_modules/lit/polyfill-support.js"></script>
<!-- web components -->
<script type="module" src="../../lib/index.js"></script>
</head>

<body>
<div class="uk-container">
<h1>&lt;lis-histogram-element&gt;</h1>
<p>
The <code>&lt;lis-histogram-element&gt;</code> provides a generic component for rendering a histogram using <a href="https://d3js.org/">D3.js</a>.
</p>
<p>
In the example below, the 'Rating' and 'Cheese' columns from the <code>&lt;lis-simple-table-element&gt;</code> are used
to generate the histogram.
</p>
<hr>
<lis-simple-table-element id="table"></lis-simple-table-element>
<lis-histogram-element id="histogram"></lis-histogram-element>
</div>
<!--Set all attributes/properties via JavaScript for lis-simple-table-element-->
<script type="text/javascript">
window.onload = (event) => {
// get the simple table element
const tableElement = document.getElementById('table');
// set the element's properties
tableElement.caption = 'My cheesy table';
tableElement.dataAttributes = ['cheese', 'region', 'rating'];
tableElement.header = {cheese: 'Cheese', region: 'Region', rating: 'Rating'};
tableElement.data = [
{cheese: 'Brie', region: 'France', rating: 7},
{cheese: 'Burrata', region: 'Italy', rating: 8},
{cheese: 'Feta', region: 'Greece', rating: 7},
{cheese: 'Gouda', region: 'Netherlands', rating: 9},
{cheese: 'Cheddar', region: 'America', rating: 6},
{cheese: 'Goat', region: 'America', rating: 2}
];

const histogramData = tableElement.data.map((d) => ({"name": d.cheese, "count": d.rating}));
const histogramElement = document.getElementById('histogram');
histogramElement.width = 500;
histogramElement.height = 500;
histogramElement.nameLabel = 'Cheese';
histogramElement.countLabel = 'Rating';
histogramElement.orientation = 'vertical';
histogramElement.data = histogramData;
}
</script>

</body>

</html>
2 changes: 1 addition & 1 deletion docs/assets/navigation.js

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

2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/classes/controllers.LisCancelPromiseController.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/classes/controllers.LisDomContentLoadedController.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/classes/controllers.LisQueryStringParametersController.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/classes/controllers.LisSlotController.html

Large diffs are not rendered by default.

Loading
Loading