Skip to content

Instantly share code, notes, and snippets.

View shprink's full-sized avatar
🏠
Working from home

Julien Renaux shprink

🏠
Working from home
View GitHub Profile
import React, { Component } from 'react';
import { format } from "d3-format";
import { timeFormat } from "d3-time-format";
import ReStock from "react-stockcharts";
const { ChartCanvas, Chart, series, scale, coordinates, tooltip, axes, helper } = ReStock;
const { LineSeries, AreaSeries, ScatterSeries, CircleMarker } = series;
const { discontinuousTimeScaleProvider } = scale;
[{"GENE_AM_FRVERSION":{"x":1480579256737,"value":132.74570750440242},"x":1480579256717},{"GENE_AM_FRVERSION":{"x":1480579257737,"value":132.59548161310022},"x":1480579257717},{"GENE_AM_FRVERSION":{"x":1480579258737,"value":132.4592377369233},"x":1480579258717},{"GENE_AM_FRVERSION":{"x":1480579259737,"value":132.34075164723976},"x":1480579259717},{"GENE_AM_FRVERSION":{"x":1480579260737,"value":132.24330699690168},"x":1480579260717},{"GENE_AM_FRVERSION":{"x":1480579261737,"value":132.1696043562665},"x":1480579261717},{"GENE_AM_FRVERSION":{"x":1480579262737,"value":132.1216862665448},"x":1480579262717},{"GENE_AM_FRVERSION":{"x":1480579263737,"value":132.10088070607463},"x":1480579263717},{"GENE_AM_FRVERSION":{"x":1480579264737,"value":132.1077642778781},"x":1480579264717},{"GENE_AM_FRVERSION":{"x":1480579265737,"value":132.14214620768396},"x":1480579265717},{"GENE_AM_FRVERSION":{"x":1480579266737,"value":132.20307366390406},"x":1480579266717},{"GENE_AM_FRVERSION":{"x":1480579267737,"value":132.28885810969572},"x
@shprink
shprink / _mixin.scss
Created October 16, 2018 17:32
Angular Material Sass to CSS variables
@function mat-color($palette-primary, $hue: default, $opacity: null) {
@if type-of($hue) == number and $hue >= 0 and $hue <= 1 {
@return mat-color($palette-primary, default, $hue);
}
$color: map-get($palette-primary, $hue);
$opacity: if($opacity == null, opacity($color), $opacity);
@if type-of($opacity) == string {
$new-string: str-replace($color, ')', '-alpha, 1)');
@mixin paletteToCssVars($palette, $prefix) {
@each $key, $value in $palette {
@if #{$key} == 'contrast' {
@include paletteToCssVars($value, $prefix + '-contrast');
} @else {
--#{$prefix}-#{$key}: #{$value};
}
}
}