This file contains 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
version: '2.1' | |
services: | |
wichita-frontend: | |
build: wichita-api-dashboard-frontend # specify the directory of the Dockerfile | |
ports: | |
- "8080:80" | |
wichita-api: | |
build: wichita-api-dashboard # specify the directory of the Dockerfile |
This file contains 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
# to install it | |
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz | |
sudo tar -xzf postman.tar.gz -C /opt | |
rm postman.tar.gz | |
sudo ln -s /opt/Postman/Postman /usr/bin/postman | |
# to create desktop entry | |
cat > ~/.local/share/applications/postman.desktop <<EOL |
This file contains 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
// Draw on canvas | |
dataExample.forEach( point => { | |
drawPoint(point); | |
}); | |
function drawPoint(point) { | |
context.beginPath(); | |
context.fillStyle = pointColor; | |
const px = x(point[0]); | |
const py = y(point[1]); |
This file contains 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
// Add Axis | |
const gxAxis = svgChart.append('g') | |
.attr('transform', `translate(0, ${height})`) | |
.call(xAxis); | |
const gyAxis = svgChart.append('g') | |
.call(yAxis); | |
// Add labels | |
svgChart.append('text') |
This file contains 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
// Init Scales | |
const x = d3.scaleLinear() | |
.domain([0, d3.max(dataExample, (d) => d[0])]) | |
.range([0, width]) | |
.nice(); | |
const y = d3.scaleLinear() | |
.domain([0, d3.max(dataExample, (d) => d[1])]) | |
.range([height, 0]) | |
.nice(); |
This file contains 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
const container = d3.select('.scatter-container'); | |
// Init SVG | |
const svgChart = container.append('svg:svg') | |
.attr('width', outerWidth) | |
.attr('height', outerHeight) | |
.attr('class', 'svg-plot') | |
.append('g') | |
.attr('transform', `translate(${margin.left}, ${margin.top})`); |
This file contains 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
const pointColor = '#3585ff' | |
const margin = {top: 20, right: 15, bottom: 60, left: 70}; | |
const outerWidth = 800; | |
const outerHeight = 600; | |
const width = outerWidth - margin.left - margin.right; | |
const height = outerHeight - margin.top - margin.bottom; |
This file contains 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
let dataExample = []; | |
for (let i= 0; i < 10000; i++) { | |
const x = Math.floor(Math.random() * 999999) + 1; | |
const y = Math.floor(Math.random() * 999999) + 1; | |
dataExample.push([x, y]); | |
} |
This file contains 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
.scatter-container { | |
margin: auto; | |
width: 800px; | |
height: 600px; | |
} | |
.svg-plot, .canvas-plot { | |
position: absolute; | |
} |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>D3 ScatterPlot</title> | |
<link rel="stylesheet" href="./styles.css"> | |
</head> | |
<body> |
NewerOlder