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
| svg | |
| .append("text") | |
| .attr("x", 230) | |
| .attr("y", 420) | |
| .style("text-anchor", "middle") | |
| .text("Last used year"); | |
| svg | |
| .append("text") | |
| .attr("x", -200) |
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
| const margin = { top: 10, right: 20, bottom: 30, left: 50 }; | |
| const width = 500 - margin.left - margin.right; | |
| const height = 420 - margin.top - margin.bottom; | |
| const xLabelHeight = 50; | |
| d3.csv("https://tutorial-node-api-k8s-ng-the-engineer.cloud.okteto.net/skills", (data) => { | |
| ... | |
| } | |
| ); | |
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
| <!DOCTYPE html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <script | |
| src="https://cdnjs.cloudflare.com/ajax/libs/d3/6.7.0/d3.min.js" | |
| integrity="sha512-cd6CHE+XWDQ33ElJqsi0MdNte3S+bQY819f7p3NUHgwQQLXSKjE4cPZTeGNI+vaxZynk1wVU3hoHmow3m089wA==" | |
| crossorigin="anonymous" | |
| referrerpolicy="no-referrer" | |
| ></script> | |
| <script src="https://d3js.org/d3-scale-chromatic.v1.min.js"></script> |
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
| svg | |
| .append("g") | |
| .selectAll("dot") | |
| .data(data) | |
| .enter() | |
| .attr("class", "bubbles") | |
| .attr("cx", (d) => x(d.lastUse)) | |
| .attr("cy", (d) => y(d.exp)) | |
| .attr("r", (d) => z(d.competency ** 3 / 100)) | |
| .style("fill", (d) => myColor(d.category)) |
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
| const showTooltip = function (d) { | |
| tooltip.transition().duration(200); | |
| tooltip | |
| .style("opacity", 1) | |
| .html(d.skill) | |
| .style("left", d3.mouse(this)[0] + 30 + "px") | |
| .style("top", d3.mouse(this)[1] + 30 + "px"); | |
| }; | |
| const moveTooltip = function (d) { |
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
| const tooltip = d3 | |
| .select("#skills_bubble_plot") | |
| .append("div") | |
| .style("position", "absolute") | |
| .style("opacity", 0) | |
| .style("background-color", "black") | |
| .style("border-radius", "5px") | |
| .style("padding", "10px") | |
| .style("color", "white"); |
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 myColor = d3 | |
| .scaleOrdinal() | |
| .domain([ | |
| "Javascript", | |
| "Frontend", | |
| "Backend", | |
| "Testing", | |
| "Database", | |
| "Programming Language", | |
| "Version Control", |
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
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: tutorial-node-api-k8s | |
| spec: | |
| replicas: 2 | |
| selector: | |
| matchLabels: | |
| name: tutorial-node-api-k8s | |
| template: |
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
| deploy: | |
| - okteto build -t okteto.dev/tutorial-node-api-k8s:latest | |
| - kubectl apply -f k8s |
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
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: tutorial-node-api-k8s | |
| labels: | |
| name: tutorial-node-api-k8s | |
| annotations: | |
| dev.okteto.com/auto-ingress: "true" | |
| spec: | |
| type: ClusterIP |