1.0.7 • Published 10 months ago

@jmoncada/vis-graph v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@jmoncada/vis-graph

Un composant web pour visualiser des graphes de connaissances SPARQL avec D3.js.

npm version license

✨ Fonctionnalités

  • 🔄 Chargement automatique depuis des endpoints SPARQL
  • 🌐 Gestion CORS/Proxy automatique
  • 🎨 Visualisation interactive avec D3.js
  • 📊 Détails enrichis pour chaque nœud
  • 🔍 Transformation intelligente des données SPARQL

🚀 Installation

npm install @jmoncada/vis-graph

📖 Utilisation rapide

1. Importation

Option A: Module ES (recommandé avec un bundler)

import '@jmoncada/vis-graph'; // Importe et enregistre le Web Component <vis-graph>

// Ou si vous avez besoin d'accéder à la classe directement (moins courant pour juste l'utiliser)
// import { VisGraph } from '@jmoncada/vis-graph'; 

Option B: UMD (pour une utilisation directe dans le navigateur via <script>)

Incluez le script dans votre HTML.

<script src="https://unpkg.com/@jmoncada/vis-graph@latest/dist/vis-graph.umd.js"></script>

2. Utilisation en HTML

<vis-graph id="monGraphe" width="800" height="600"></vis-graph>

<script>
  const graphe = document.getElementById('monGraphe');

  // Exemple simple avec Wikidata
  graphe.loadFromSparqlEndpoint(
    'https://query.wikidata.org/sparql',
    `SELECT ?item ?itemLabel WHERE {
      ?item wdt:P31 wd:Q5 .
      SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" }
    } LIMIT 10`
  ).then(result => {
    if (result.status === 'success') {
      console.log('Graphe chargé avec', result.data.nodes.length, 'nœuds');
    }
  });
</script>

Documentation

📚 Guides détaillés disponibles :

Licence

Ce projet est sous licence MIT.

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago