# gexf-writer

> A simple GEXF format writer

Latest version **0.1.2** (published 2014-06-29) · 0 weekly downloads

## Install

```sh
npm install gexf-writer
pnpm add gexf-writer
yarn add gexf-writer
bun add gexf-writer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2014-06-29 |
| First published | 2014-06-22 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Daniel Martinez |
| Maintainers | danibrutal |
| Keywords | gexf, gexf writer, gexf format, graphs, graphs visualization |

## Links

- npm: https://www.npmjs.com/package/gexf-writer
- Repository: https://github.com/danibrutal/gexf-writer
- Issues: https://github.com/danibrutal/gexf-writer/issues
- npm.io page: https://npm.io/package/gexf-writer

## Dependencies (2)

- [requirejs](https://npm.io/package/requirejs.md) ^2.1.14
- [xml-writer](https://npm.io/package/xml-writer.md) ^1.4.1

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2014-06-29
- 0.1.1 — 2014-06-22
- 0.0.1 — 2014-06-22

## README

# JavaScript GEXF Writer 

[![Build Status](https://travis-ci.org/danibrutal/gexf-writer.svg)](https://travis-ci.org/danibrutal/gexf-writer)

# Installation

With [npm](http://npmjs.org) do:

    $ npm install gexf-writer

# Examples

## Basic
```javascript
    var GexfWriter = require('gexf-writer');    
    var gw = new GexfWriter();
    var doc = gw.createDocument({
      type: 'directed',
      attributes: {
        foo: {
            type: 'string',
            default: 'foo default values'
        }
      }
    });

    doc
    .addNode("1", "node label", {
        foo: "val1",
        bar: "val2"
    })
     .addNode("2", "node label 2")
     .addEdge("edgeId", "1", "2");

    console.log(doc.toString());
```
Output:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<gexf xmlns="http://www.gexf.net/1.2draft" version="1.2">
   <meta>
      <creator>gexf-writer</creator>
      <description>GEXF document generated by gexf-writer</description>
   </meta>
   <graph defaultedgetype="directed">
      <nodes>
         <node id="1" label="node label" />
         <node id="2" label="node label 2" />
      </nodes>
      <edges>
         <edge id="edgeId" source="1" target="2" />
      </edges>
   </graph>
</gexf>
```

# Tests
With [mocha](http://visionmedia.github.io/mocha) do:

    $ mocha

# License

[MIT/X11](./LICENSE)

---
_Source: https://npm.io/package/gexf-writer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
