Git Product home page Git Product logo

echarts-graph-modularity's Introduction

graph modularity extension for Apache ECharts

Graph modularity extension will do community detection and partition a graph's vertices in several subsets. Each subset will be assigned a different color.

Install

<script src="echarts.min.js"></script>
<script src="echarts-graph-modularity.min.js"></script>

Or

npm install echarts-graph-modularity
import * as echarts from 'echarts';
import 'echarts-graph-modularity';

NOTE:

V2.x is for ECharts 5.x

Usage

setOption({

    ...

    series: [{
        type: 'graph',
        layout: 'force',
        // Set modularity property true and extension will automatically detect different communities
        // and assign each different color.
        modularity: true

        // Specify resolution. Higher resolution will produce less communities
        modularity: {
            resolution: 5,
            // If sort the communities
            sort: false
        }

        ...
    }]
})

Notice

The Apache Software Foundation Apache ECharts, ECharts, Apache, the Apache feather, and the Apache ECharts project logo are either registered trademarks or trademarks of the Apache Software Foundation.

echarts-graph-modularity's People

Contributors

100pah avatar ovilia avatar pissang avatar the-alchemist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

echarts-graph-modularity's Issues

[Feature Request] access to community data

Description

Thanks to echarts, echarts-gl and echarts-graph-modularity, I've succeeded in displaying a complex weighted network with partitioned communities distinguished by colors. ๐ŸŽ‰

However, in addition to network modularity display, I needed to obtain the detailed data of each community composition, such as the members which could be used for further analysis. ๐Ÿ™‚

As far as I know, no existing method is provided to access the graph resolution result, which I think it's a missing valuable feature. ๐Ÿ™

Personal

To obtain the community data, I cloned the repo, opened the main.js, allocated a variable to collect resolution result, and exposed it as payload through a custom event.

Pretty damage to the source code! ๐Ÿ˜จ

Expected

May it extends an echarts instance method (or a better way you say), so that I just need to write simple as follows: ๐Ÿค“

require('echarts-graph-modularity')

...

// when I want community data
var result = chart.getCommunitiesData()

// result
[
    {
        color: '#c23632',
        members: ['nodeA', 'nodeB', ...]
    },
    ...
]


So, what's your opinion?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.