This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { stringify } from 'qs'; | |
import { isObject } from 'lodash/fp'; | |
import { nanoid } from 'nanoid'; | |
const url = '/a/track-envent'; | |
const CID_KEY = '_acid'; | |
export const createAnalytics = ({ apiOrigin }) => { | |
let context = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dom = require('virtual-dom'); | |
var fromHTML = require('virtual-html'); | |
var html = '<svg namespace = "http://www.w3.org/2000/svg" class="stats-aside__svg" height="160" width="160"> <circle namespace = "http://www.w3.org/2000/svg" class="stats-aside__svg-bg" cx="80" cy="80" r="78" stroke="#f2f2f2" stroke-width="4" fill="none" ></circle> <circle namespace = "http://www.w3.org/2000/svg" class="stats-aside__svg-progress" cx="80" cy="80" r="78" stroke="#f9c033" stroke-width="4" fill="none" stroke-dashoffset="228.92" stroke-dasharray="503, 999"></circle> </svg>' | |
var svgTags = { | |
'CIRCLE': true, | |
'CLIPPATH': true, | |
'DEFS': true, | |
'ELLIPSE': true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dom = require('virtual-dom'); | |
var fromHTML = require('virtual-html'); | |
var toHTML = require('vdom-to-html'); | |
var html = '<svg namespace = "http://www.w3.org/2000/svg" class="stats-aside__svg" height="160" width="160"> <circle namespace = "http://www.w3.org/2000/svg" class="stats-aside__svg-bg" cx="80" cy="80" r="78" stroke="#f2f2f2" stroke-width="4" fill="none" ></circle> <circle namespace = "http://www.w3.org/2000/svg" class="stats-aside__svg-progress" cx="80" cy="80" r="78" stroke="#f9c033" stroke-width="4" fill="none" stroke-dashoffset="228.92" stroke-dasharray="503, 999"></circle> </svg>' | |
var vsvg = fromHTML(html); | |
var node = dom.create(vsvg); | |
document.body.appendChild(node) |