Back to Pinpoint

@pinpoint-fe/server-map

web-frontend/src/main/v3/packages/server-map/README.md

3.0.52.1 KB
Original Source

alpha version

@pinpoint-fe/server-map

🔎 Overview

  • ServerMap component is an open-source network-map library, specifically for application topology.
  • With ServerMap component, you will find it easy to understand how your services are interconnected and how the transactions are going on between them.
  • Besides, since we provide a various of cool features such as merge and customizing label, feel free to check out them if you are interested in making your topology look nicer.
  • For your information, ServerMap component builds the network-map using cytoscape.js which is light, highly optimized and well-maintained so it's all ready to provide a pleasant experience.

⚙️ Installation

sh
npm install @pinpoint-fe/server-map

or

sh
yarn add @pinpoint-fe/server-map

🚀 Quick Start

Create your first ServerMap

typescript
import React from 'react';
import { ServerMap } from '@pinpoint-fe/server-map';

export default function MyServerMapPage() {
  return (
    <ServerMap 
      data={data}
      baseNodeId={'MY-APP'} 
    />
  );
}

Props

PropsTypeRequiredDescription
data<code>{ nodes: Node[], edges: Edge[] }</code>✔️Data to render
baseNodeIdstring✔️Central node id in the server-map
customThemeThemeTypeCustom style object
onClickNodeClickEventHandler<MergedNode>Callback to execute when clicking nodes
onClickEdgeClickEventHandler<MergedEdge>Callback to execute when clicking edges
onClickBackgroundClickEventHandler<{}>Callback to execute when clicking background
renderNodeLabel(node: MergedNode) => string ㅣ undefinedCustom node label
renderEdgeLabel(node: MergedEdge) => string ㅣ undefinedCustom edge label