Skip to content

Instantly share code, notes, and snippets.

View mishuagopian's full-sized avatar

Mishu Agopian mishuagopian

View GitHub Profile
function processPoints (firstPoint, secondPoint, thirdPoint, sessionPoints, width, height, radius = width * 0.05) {
const initialPoints = [firstPoint, secondPoint, thirdPoint];
let transformedPoints = sessionPoints.concat(initialPoints);
// Traslate all points moving the secondPoint to (0, 0) on the plane
transformedPoints = transformedPoints.map((p) => {
return {
x: p.x - secondPoint.x,
y: p.y - secondPoint.y
};
<!DOCTYPE html>
<html>
<head>
<title> Heatmap page </title>
<script type="text/javascript" src="heatmap.min.js"></script>
</head>
<body>
<div class="heatmap" style="height: 250px; width: 100%;" />
</body>
</html>
import React, { Component } from 'react';
import { Platform, View, WebView } from 'react-native';
import HeatmapUtils from '../../utils/HeatmapUtils';
export default class Heatmap extends Component {
componentDidMount() {
setTimeout(
function heatmapInputGenerator (points, radius, max) {
return `
var heatmapInstance = h337.create({
container: document.querySelector('.heatmap'),
radius: ${radius}
});
heatmapInstance.setData({
max: ${max},
data: ${JSON.stringify(points)}
});
@mishuagopian
mishuagopian / data.json
Created March 23, 2017 01:19
Extender del gráfico de barras - Agopian
[
{ "provincia": "Buenos Aires", "poblacion": 15625084 },
{ "provincia": "Córdoba", "poblacion": 3308876 },
{ "provincia": "Santa Fe", "poblacion": 3194537},
{ "provincia": "Ciudad Autónoma de Buenos Aires", "poblacion": 2890151},
{ "provincia": "Mendoza", "poblacion": 1738929},
{ "provincia": "Tucumán", "poblacion": 1448188},
{ "provincia": "Entre Ríos", "poblacion": 1235994},
{ "provincia": "Salta", "poblacion": 1214441},
{ "provincia": "Misiones", "poblacion": 1101593},
@mishuagopian
mishuagopian / DataBaseContext.cs
Created June 19, 2017 21:24
Net Core Training - MVC - Models
// Models/DataBaseContext.cs
#region Using
using Microsoft.EntityFrameworkCore;
using MvcMovie.Models;
#endregion
namespace MvcMovie.Models
@mishuagopian
mishuagopian / StartUp.cs
Last active June 19, 2017 21:42
Net Core Training - PostgreSQL configuration
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.EntityFrameworkCore;
-# TODO: Remove access with [] when proof of concept is finished
- if params[:modal] != 'true'
- if @model[:company].present?
.configurator-header
%h1.configurator-header-title
= @model[:name].humanize
.configurator-header-subtitle
.configurator-header-company
= @model[:company][:name]
- else