Commit d745a6d3 authored by Vasily Belolapotkov's avatar Vasily Belolapotkov

add check icon to the legend

parent d8e3cc45
......@@ -6062,6 +6062,12 @@
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
"dev": true
},
"simple-html-tokenizer": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/simple-html-tokenizer/-/simple-html-tokenizer-0.1.1.tgz",
"integrity": "sha1-BcLuxXn//+FFoDCsJs/qYbmA+r4=",
"dev": true
},
"snapdragon": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
......@@ -6542,6 +6548,43 @@
"has-flag": "3.0.0"
}
},
"svg-inline-loader": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/svg-inline-loader/-/svg-inline-loader-0.8.0.tgz",
"integrity": "sha512-rynplY2eXFrdNomL1FvyTFQlP+dx0WqbzHglmNtA9M4IHRC3no2aPAl3ny9lUpJzFzFMZfWRK5YIclNU+FRePA==",
"dev": true,
"requires": {
"loader-utils": "0.2.17",
"object-assign": "4.1.1",
"simple-html-tokenizer": "0.1.1"
},
"dependencies": {
"big.js": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz",
"integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==",
"dev": true
},
"json5": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
"integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=",
"dev": true
},
"loader-utils": {
"version": "0.2.17",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz",
"integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=",
"dev": true,
"requires": {
"big.js": "3.2.0",
"emojis-list": "2.1.0",
"json5": "0.5.1",
"object-assign": "4.1.1"
}
}
}
},
"tapable": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.1.tgz",
......
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="check" class="svg-inline--fa fa-check fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path></svg>
\ No newline at end of file
......@@ -164,6 +164,7 @@ body {
left: $controlVPadding - $controlBorderR;
border: 1px solid $grey;
color: #fff;
background-color: #fff;
transition: background-color 0.3s ease;
}
......@@ -177,3 +178,11 @@ body {
}
}
}
.icon {
display: inline-block;
width: 1rem;
height: 1rem;
line-height: 1rem;
padding: 4px;
}
import checkSolidSvg from '../assets/check-solid.svg';
import { makeHtmlElement } from './ui-utils';
export function makeCheckIcon(): HTMLElement {
const el = makeHtmlElement('i', {
classList: ['icon'],
});
el.innerHTML = checkSolidSvg;
return el;
}
import { ChartComponentFactory, DOMContainerElement } from './chart-component';
import { applyElementConfig, makeHtmlElement } from './ui-utils';
import { IDataSet } from './chart-state';
import { makeCheckIcon } from './check-icon';
export const makeLegend: ChartComponentFactory<null> = function(
chartStateController,
......@@ -57,6 +58,8 @@ export const makeLegend: ChartComponentFactory<null> = function(
},
});
checkbox.appendChild(makeCheckIcon());
const label = makeHtmlElement('div', {
classList: ['label'],
});
......
......@@ -2,3 +2,8 @@ declare module '*.json' {
const content: any;
export default content;
}
declare module '*.svg' {
const content: any;
export default content;
}
......@@ -34,6 +34,10 @@ module.exports = {
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.svg$/,
loader: 'svg-inline-loader'
},
],
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment