@helpwave/hightide
Version:
helpwave's component and theming library
243 lines (242 loc) • 5.88 kB
JavaScript
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/components/TechRadar.tsx
var TechRadar_exports = {};
__export(TechRadar_exports, {
TechRadar: () => TechRadar
});
module.exports = __toCommonJS(TechRadar_exports);
var import_react = require("react");
var import_script = __toESM(require("next/script"));
var import_jsx_runtime = require("react/jsx-runtime");
var helpwaveTechRadar = {
date: /* @__PURE__ */ new Date("1/28/2024"),
config: {
colors: {
background: "#fff",
grid: "#dddde0",
inactive: "#ddd"
},
title: "helpwave Tech-Radar",
quadrants: [
{ name: "Languages" },
{ name: "Language dependencies" },
{ name: "Infrastructure" },
{ name: "Datastores" }
],
rings: [
{ name: "ADOPT", color: "#5ba300" },
{ name: "TRIAL", color: "#009eb0" },
{ name: "ASSESS", color: "#c7ba00" },
{ name: "HOLD", color: "#e09b96" }
],
print_layout: true,
links_in_new_tabs: true
},
entries: [
// Languages
{
label: "Golang",
active: true,
quadrant: 0,
ring: 0,
moved: 0
},
{
label: "Python",
active: true,
quadrant: 0,
ring: 2,
moved: 0
},
{
label: "TypeScript",
active: true,
quadrant: 0,
ring: 0,
moved: 0
},
{
label: "Dart",
active: true,
quadrant: 0,
ring: 0,
moved: 0
},
// Language dependencies
{
label: "Dapr",
link: "https://dapr.io/",
active: true,
quadrant: 1,
ring: 0,
moved: 0
},
{
label: "GORM",
active: true,
quadrant: 1,
ring: 3,
moved: -1
},
{
label: "SQLc",
active: true,
quadrant: 1,
ring: 0,
moved: 1
},
{
label: "Flutter",
active: true,
quadrant: 1,
ring: 0,
moved: 0
},
{
label: "Next.js",
active: true,
quadrant: 1,
ring: 0,
moved: 0
},
// Infrastructure
{
label: "Docker",
active: true,
quadrant: 2,
ring: 0,
moved: 0
},
{
label: "Kubernetes",
active: true,
quadrant: 2,
ring: 2,
moved: 1
},
{
label: "gRPC",
active: true,
quadrant: 2,
ring: 0,
moved: 0
},
{
label: "APISIX",
active: true,
quadrant: 2,
ring: 0,
moved: 0
},
{
label: "GitHub Actions",
active: true,
quadrant: 2,
ring: 0,
moved: 0
},
{
label: "devenv",
active: true,
quadrant: 2,
ring: 1,
moved: 0
},
// Datastores
{
label: "PostgreSQL",
active: true,
quadrant: 3,
ring: 0,
moved: 0
},
{
label: "Redis",
active: true,
quadrant: 3,
ring: 0,
moved: 0
},
{
label: "EventStoreDB",
active: true,
quadrant: 3,
ring: 1,
moved: 0
}
]
};
var TechRadar = ({
date = helpwaveTechRadar.date,
config = helpwaveTechRadar.config,
entries = helpwaveTechRadar.entries
}) => {
const [isD3Loaded, setIsD3Loaded] = (0, import_react.useState)(false);
const [isRadarLoaded, setIsRadarLoaded] = (0, import_react.useState)(false);
const dateString = date.toLocaleDateString("en-US", { year: "numeric", month: "numeric", day: "numeric" });
(0, import_react.useEffect)(() => {
if (!isD3Loaded || !isRadarLoaded) return;
d3.select("svg#radar").select("*").remove();
radar_visualization({
svg_id: "radar",
width: 1500,
height: 1e3,
date: dateString,
entries,
...config
});
}, [isD3Loaded, isRadarLoaded, config, entries]);
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
import_script.default,
{
src: "https://cdn.helpwave.de/js/d3.v4.min.js",
onLoad: () => {
setIsD3Loaded(true);
}
}
),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
import_script.default,
{
src: "https://cdn.helpwave.de/js/radar-0.8.js",
onLoad: () => {
setIsRadarLoaded(true);
}
}
),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { id: "radar" })
] });
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
TechRadar
});
//# sourceMappingURL=TechRadar.js.map