graph_pptx

package module
v0.0.0-...-7c0a912 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2018 License: MIT Imports: 4 Imported by: 0

README

bunji2/graph.pptx

Go package that extracts the graph data of nodes and edges from directed graph edited in PPTX.

Installation

go get github.com/bunji2/graph.pptx

Usage

Followin sample extracts nodes and edges from PPTX file "sample.pptx".

import (
    "fmt"
    gp "github.com/bunji2/graph.pptx"
)

func sample() {
    gp.Init()
    if err := gp.Parse("sample.pptx"); err == nil {
        gp.Dump()
    }
}

Document

License

under the MIT License

by Bunji2

Documentation

Overview

Go package that extracts the graph data of nodes and edges from directed graph edited in PPTX. PPTX で書かれたグラフデータを読み込み、ノード・エッジの情報を抽出し保持するパッケージ

Index

Constants

View Source
const (
	Unknown_shape = "unknown"
)

Variables

This section is empty.

Functions

func DoWithEdges

func DoWithEdges(f func(string, Edge) bool)

すべてのエッジに対して処理を行う関数 関数 f の処理結果が false となったらそこで中断する。

func DoWithNodes

func DoWithNodes(f func(string, Node) bool)

すべてのノードに対して処理を行う関数 関数 f の処理結果が false となったらそこで中断する。

func Dump

func Dump()

すべてのノードとエッジをダンプするデバッグ用関数

func Init

func Init()

初期化関数。必須。

func Parse

func Parse(filename string) error

ファイルから、ノードとエッジを抽出する関数。 グローバル変数 nodes と edges に抽出結果を保存する。

Types

type Edge

type Edge struct {
	Src string
	Dst string
}

エッジの型(起点となるノードと終点となるノード)

func GetEdgeOf

func GetEdgeOf(eid string) Edge

指定したIDのエッジを取得する関数

func (Edge) String

func (n Edge) String() string

エッジのオブジェクトを文字列にするメソッド

type EdgeMap

type EdgeMap map[string]Edge

エッジのマップの型(文字列→エッジ)

func (EdgeMap) Dump

func (em EdgeMap) Dump()

すべてのエッジをダンプするメソッド

type Node

type Node struct {
	Label string
	Shape Shape
}

ノードの型(ラベル+ノードシェイプ)

func GetNodeOf

func GetNodeOf(nid string) Node

指定したIDのノードを取得する関数

func (Node) String

func (n Node) String() string

ノードのオブジェクトを文字列にするメソッド

type NodeMap

type NodeMap map[string]Node

ノードのマップの型(文字列→ノード)

func (NodeMap) Dump

func (nm NodeMap) Dump()

すべてのノードをダンプするメソッド

func (NodeMap) HasNid

func (nm NodeMap) HasNid(nid string) bool

ノードID nid が nodes に含まれるかをチェックするメソッド

type Shape

type Shape string

ノードシェイプの型

func NewShape

func NewShape(str string) (r Shape, ok bool)

新しいノードシェイプの値を文字列から作る関数

func (Shape) String

func (s Shape) String() string

ノードシェイプの型の値を文字列にするメソッド

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL