npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

koddiv-organizational-chart

v0.1.1

Published

React organizasyon şeması — modern, erişilebilir, özelleştirilebilir

Readme

koddiv-organizational-chart

React için organizasyon şeması bileşeni. Düz liste (id/parentId), nested veri veya JSX ile kullanım. Zoom/pan viewport, arama, expand/collapse, drawer ve çoklu kök desteği.

Gereksinimler: React 16.8+, Node 18+

Kurulum

npm install koddiv-organizational-chart

Stilleri projenize ekleyin:

import 'koddiv-organizational-chart/styles.css';

Hızlı başlangıç

Düz liste (nodes)id ve parentId ile; kök için parentId: null:

import { OrgChart, type OrgChartDataItem } from 'koddiv-organizational-chart';
import 'koddiv-organizational-chart/styles.css';

const nodes: OrgChartDataItem[] = [
  { id: '1', parentId: null, label: <span>Genel Müdür</span>, name: 'Ayşe', surname: 'Yılmaz', title: 'GM', email: '[email protected]' },
  { id: '2', parentId: '1', label: <span>CTO</span>, name: 'Ali', surname: 'Demir', title: 'CTO', email: '[email protected]' },
  { id: '3', parentId: '1', label: <span>CHRO</span>, name: 'Fatma', surname: 'Kaya', title: 'CHRO', email: '[email protected]' },
];

<OrgChart nodes={nodes} onNodeClick={(item) => console.log(item)} />

Arama + viewport ile (tek prop ile açılıp kapanan arama):

import { OrgChart } from 'koddiv-organizational-chart';
import 'koddiv-organizational-chart/styles.css';

<OrgChart.WithSearch
  nodes={nodes}
  searchable={true}
  searchPlaceholder="İsim veya ünvan ile ara..."
  viewportHeight="100%"
  onNodeClick={setSelectedItem}
  emptyMessage="Sonuç bulunamadı."
/>
<OrgChart.Drawer item={selectedItem} onClose={() => setSelectedItem(null)} />

Çoklu kök (birden fazla parentId: null) — üstte sanal kök etiketi:

<OrgChart
  nodes={nodes}
  virtualRootLabel="Şirket Adı"
  onNodeClick={setSelectedItem}
/>

Nested veri (data):

import type { OrgChartNodeData } from 'koddiv-organizational-chart';

const data: OrgChartNodeData = {
  id: 'root',
  label: <div>Kök</div>,
  children: [
    { id: 'a', label: <div>Alt 1</div> },
    { id: 'b', label: <div>Alt 2</div>, children: [...] },
  ],
};
<OrgChart data={data} />

Declarative (JSX):

<OrgChart label={<div>Kök</div>}>
  <OrgChart.Node label={<div>Alt 1</div>} />
  <OrgChart.Node label={<div>Alt 2</div>}>
    <OrgChart.Node label={<div>Alt 2.1</div>} />
  </OrgChart.Node>
</OrgChart>

Sadece zoom/pan viewport:

<OrgChart.Viewport height="70vh" wheelZoom={true}>
  <OrgChart nodes={nodes} />
</OrgChart.Viewport>

API özeti

| Bileşen / fonksiyon | Açıklama | |---------------------|----------| | OrgChart | Ana şema. nodes | data | label+children | | OrgChart.WithSearch | Üstte arama çubuğu + viewport + şema. searchable, nodes zorunlu | | OrgChart.Viewport | Zoom, pan, fit. height, className, wheelZoom | | OrgChart.Drawer | Sağdan açılan detay. item, onClose | | OrgChart.SearchBar | Arama input. value, onChange, placeholder | | filterNodesBySearch(nodes, query) | Arama metnine göre filtreler (name, surname, title, email); Türkçe karakter uyumlu |

OrgChart props: nodes, data, label, children, onNodeClick, loading, emptyMessage, lineHeight, lineWidth, lineColor, lineStyle, lineBorderRadius, nodePadding, expandedIds, initialExpandedIds, onExpandedChange, virtualRootLabel, className.

OrgChartDataItem: id, parentId, label, name?, surname?, title?, email?, phone?, avatar? (drawer ve kartta kullanılır).

Performans: Sadece açık dallar render edilir. 2000+ düğümde varsayılan olarak yalnızca kök açık başlar; initialExpandedIds ile özelleştirilebilir.

Geliştirme

Gereksinim: Node 18+

npm install
npm run dev

Demo: http://localhost:5173 (Vite).

  • npm run build — Kütüphane build (dist/); NPM yayını için.
  • npm run build:demo — Demo uygulaması build (dist-demo/).
  • npm run preview — Build edilmiş demoyu önizleme.

Yayında pakete yalnızca dist/ dahil edilir.