Testing legend with scroll for an overtly long legend. Test has simple fade out of lines on click of legend item, and moves the legend on roll over of bar lines. Use the slider to increase/decrease the lines and keys in legend.
| const isArray = Array.isArray; | |
| const keyList = Object.keys; | |
| const hasProp = Object.prototype.hasOwnProperty; | |
| export function isDeeplyEqual<T extends any>(a: T, b: T): boolean { | |
| if (a === b) { return true; } | |
| if (a && b && typeof a === 'object' && typeof b === 'object') { | |
| const arrA = isArray(a) |
| <div class="app"> | |
| </div> |
CATF44LT7C-eyJsaWNlbnNlSWQiOiJDQVRGNDRMVDdDIiwibGljZW5zZWVOYW1lIjoiVmxhZGlzbGF2IEtvdmFsZW5rbyIsImFzc2lnbmVlTmFtZSI6IiIsImFzc2lnbmVlRW1haWwiOiIiLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJGb3IgZWR1Y2F0aW9uYWwgdXNlIG9ubHkiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IklJIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiQUMiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJEUE4iLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJQUyIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IkdPIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiRE0iLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJDTCIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJTMCIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJDIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiUkQiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJQQyIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJNIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiV1MiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJEQiIsI
| // CatInputs.js | |
| import React from 'react'; | |
| import PropTypes from 'prop-types'; | |
| const CatInputs = ({ idx, catState, handleCatChange }) => { | |
| const catId = `name-${idx}`; | |
| const ageId = `age-${idx}`; | |
| return ( | |
| <div key={`cat-${idx}`}> |
| import React, { Component } from "react"; | |
| import { render } from "react-dom"; | |
| import "./index.css"; | |
| class Widget extends Component { | |
| state = { text: "" }; | |
| handleChange = (e) => { | |
| this.setState({ text: e.target.value }); | |
| }; | |
| render() { |
| /* | |
| ##Device = Desktops | |
| ##Screen = 1281px to higher resolution desktops | |
| */ | |
| @media (min-width: 1281px) { | |
| //CSS | |
| import { AfterViewInit, Directive, ElementRef, NgZone, OnDestroy } from '@angular/core'; | |
| import { NavigationEnd, NavigationStart, Router } from '@angular/router'; | |
| import { Subscription } from 'rxjs/Subscription'; | |
| import { ScrollTrackerService } from './scroll-tracker.service'; | |
| @Directive({ | |
| selector: '[scrollTracker]' | |
| }) | |
| export class ScrollTrackerDirective implements AfterViewInit, OnDestroy { |
| class Tracker { | |
| count = 0; | |
| constructor() { | |
| window.addEventListener("mousedown", this.mouseDown); | |
| window.addEventListener("mouseup", this.mouseUp); | |
| } | |
| mouseDown = (ev: MouseEvent) => { | |
| window.addEventListener("mousemove", this.mouseMove); | |
| } | |
| mouseUp = (ev: MouseEvent) => { |