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
/** | |
* this function will abbreviate a number to a string | |
* It's only for charts as it takes into account the label range | |
* and shortens accordingly. | |
* | |
* @param {Number} value | |
* @param {Number} min | |
* @param {Number} max | |
* @param {Number} minimumFractionDigits | |
* @param {Number} labelCount |
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 gql from 'graphql-tag'; | |
import { client } from './apollo' | |
// const { createDBConnection } = require('./mongo') | |
const getActivity = async (portfolio) => { | |
const q = gql` | |
query ActivityByPortfolioId($portfolio: String!) { | |
activityByPortfolioId(portfolio: $portfolio, _size: 9999) { | |
data { | |
_id |
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
<template> | |
<div class="page section"> | |
<div class="hero is-large"> | |
<div class="hero-body"> | |
<center> | |
<h3 class="is-size-4"> | |
<button class="button is-loading is-white"></button> | |
<span>Moment kurz ☕</span> | |
</h3> | |
</center> |
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
{ | |
"type": "Feature", | |
"properties": { | |
"radius": 443.0003055263856, | |
}, | |
"geometry": { "type": "Point", "coordinates": [-74.008317, 40.72251] } | |
} |
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 { forEach } from 'lodash'; | |
createLayersFromJson(data) { | |
const layers = []; | |
forEach(data, (geo, id) => { | |
L.geoJSON(geo, { | |
pointToLayer: (feature, latlng) => { | |
if (feature.properties.radius) { | |
return new L.Circle(latlng, feature.properties.radius); |
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
transformLayerToJson(layer) { | |
const json = layer.toGeoJSON(); | |
if (layer instanceof L.Circle) { | |
json.properties.radius = layer.getRadius(); | |
} | |
return json; | |
} |
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
describe('Draw & Edit Polygons', () => { | |
it('correctly draws a polygon', () => { | |
cy.toolbarButton('polygon').click(); | |
cy.get('#map') | |
.click(390, 250) | |
.click(400, 50) | |
.click(450, 50) | |
.click(450, 150) |
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
describe('Draw & Edit Polygons', () => { | |
it('correctly draws a polygon', () => { | |
// nothing yet | |
}); | |
}); |
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
describe('Draw & Edit Polygons', () => { | |
it('correctly draws a polygon', () => { | |
cy.toolbarButton('polygon') | |
.closest('.button-container') | |
.should('have.not.class', 'active'); | |
cy.toolbarButton('polygon') | |
.click() | |
.closest('.button-container') |
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
describe('Draw & Edit Polygons', () => { | |
it('correctly draws a polygon', () => { | |
cy.toolbarButton('polygon') | |
.closest('.button-container') | |
.should('have.not.class', 'active'); | |
cy.toolbarButton('polygon') | |
.click() | |
.closest('.button-container') |
NewerOlder