@internetarchive/histogram-date-range v1.2.1
\
Check out the interactive demo.
This webcomponent follows the open-wc recommendation.
Installation
npm i @internetarchive/histogram-date-rangeUsage
<script type="module">
import 'histogram-date-range/dist/src/histogram-date-range.js';
</script>
<histogram-date-range
width="300"
height="50"
tooltipWidth="140"
dateFormat="DD MMM YYYY"
style="
--histogramDateRangeTooltipFontSize: 1rem;
--histogramDateRangeInputWidth: 85px;
"
minDate="1400"
maxDate="2021"
minSelectedDate="1800"
maxSelectedDate="1900"
bins="[ 74, 67, 17, 66, 49, 93, 47, 61, 32, 46, 53, 2,
13, 45, 28, 1, 8, 70, 37, 74, 67, 17, 66, 49, 93,
47, 61, 70, 37, 74, 67, 17, 66, 49, 93, 47, 61, 32,
32, 70, 37, 74, 67, 17, 66, 49, 93, 47, 61, 32
]"
></histogram-date-range>A slot named inputs-right-side is available for inserting elements to the right
of the min/max date input fields, e.g.:
<histogram-date-range>
<button slot="inputs-right-side">Apply</button>
</histogram-date-range>Linting with ESLint, Prettier, and Types
To scan the project for linting errors, run
npm run lintYou can lint with ESLint and Prettier individually as well
npm run lint:eslintnpm run lint:prettierTo automatically fix many linting errors, run
npm run formatYou can format using ESLint and Prettier individually as well
npm run format:eslintnpm run format:prettierTesting with Web Test Runner
To run the suite of Web Test Runner tests, run
npm run testTo run the tests in watch mode (for <abbr title="test driven development">TDD</abbr>, for example), run
npm run test:watchTooling configs
For most of the tools, the configuration is in the package.json to reduce the amount of files in your project.
If you customize the configuration a lot, you can consider moving them to individual files.
Local Demo with web-dev-server
npm startTo run a local development server that serves the basic demo located in demo/index.html
9 months ago
9 months ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago