All Projects โ†’ cedoor โ†’ mmp

cedoor / mmp

Licence: MIT license
๐Ÿ“˜ Light JavaScript library to create mind map applications.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to mmp

Yana
Powerful note-taking app with nested documents, full-text search, rich-text editor, code snippet editor and more
Stars: โœญ 87 (+17.57%)
Mutual labels:  organization
Resources
Project proposals
Stars: โœญ 155 (+109.46%)
Mutual labels:  organization
project-organization
YunoHost project organization
Stars: โœญ 31 (-58.11%)
Mutual labels:  organization
Fgh
๐Ÿ“ Automate the lifecycle and organization of your cloned GitHub repositories
Stars: โœญ 107 (+44.59%)
Mutual labels:  organization
Fraternate
Fraternate is a standalone copy of the GitHub organization and user interaction framework. Built with Mongo dB | Node.jsยฎ | Express.js | Handlebars.js | Bootstrap.
Stars: โœญ 130 (+75.68%)
Mutual labels:  organization
Orgchart
It's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.
Stars: โœญ 2,325 (+3041.89%)
Mutual labels:  organization
Restify Router
A router interface for restify that lets you aggregate route definitions and apply to a restify server
Stars: โœญ 45 (-39.19%)
Mutual labels:  organization
tomsup
tomsup ๐Ÿ‘ Theory of Mind Simulation using Python. A package that allows for easy agent-based modelling of recursive Theory of Mind
Stars: โœญ 49 (-33.78%)
Mutual labels:  mind
Follow Github Organisation
Get notified when a new repository is created in a GitHub organisation
Stars: โœญ 143 (+93.24%)
Mutual labels:  organization
guide
Maintenance Guidelines for GitHub/npm organization.
Stars: โœญ 12 (-83.78%)
Mutual labels:  organization
Hypertag
Knowledge Management for Humans using Machine Learning & Tags
Stars: โœญ 116 (+56.76%)
Mutual labels:  organization
Asnip
ASN target organization IP range attack surface mapping for reconnaissance, fast and lightweight
Stars: โœญ 126 (+70.27%)
Mutual labels:  organization
Orgmanager
Invite System for GitHub Organizations
Stars: โœญ 196 (+164.86%)
Mutual labels:  organization
Unused Style Remover
Remove unused layer and text styles.
Stars: โœญ 94 (+27.03%)
Mutual labels:  organization
scif
scientific filesystem: a filesystem organization for scientific software and metadata
Stars: โœญ 30 (-59.46%)
Mutual labels:  organization
React Native Folder Structure
Ideal folder organization scheme for react-native with use redux applications
Stars: โœญ 84 (+13.51%)
Mutual labels:  organization
Vue Orgchart
It's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.
Stars: โœญ 182 (+145.95%)
Mutual labels:  organization
automate-branch-rules-cli
The tool lets you automate the addition, removal or alteration of the branch protection rules for 1 or more branches & repositories in one go.
Stars: โœญ 29 (-60.81%)
Mutual labels:  organization
sensible-github-labels
Github labels for teams that like workflows and structure
Stars: โœญ 121 (+63.51%)
Mutual labels:  organization
Vue Org Chart
Manage and publish your interactive organization chart (orgchart), 100% free and no install required: just copy a folder to any location
Stars: โœญ 207 (+179.73%)
Mutual labels:  organization

๐Ÿ’” Project no longer supported

Fork it to continue development!

Mmpbeta

Mmp was born with the intention to make the creation of maps extremely simple, while maintaining the fundamental properties that make the mind maps so efficient:

  • Colors ๐ŸŒˆ
  • Images ๐Ÿ—ป
  • Neural branches โคด๏ธ
  • Hierarchical structure ๐Ÿ‘ช
  • Radial geometry ๐ŸŒด

Mmp is a light JavaScript library (which uses the UMD pattern) with which it is possible to create mind map applications. It is highly customizable, easy to use and it is written using TypeScript and the famous D3.js library. All its functions are documented with JSDoc markup language and tested with mocha and chai.

Installing

npm

You can install mmp package with npm:

npm install mmp --save

Then add the mmp library with d3.js to your index.html:

<div id="map"></div>

<script src="node_modules/d3/build/d3.min.js"></script>
<script src="node_modules/mmp/build/mmp.min.js"></script>
<script>
    let myMap = mmp.create("map");
</script>

CDN

You can also load it using a <script> using the unpkg CDN:

<div id="map"></div>

<script src="https://unpkg.com/d3/build/d3.min.js"></script>
<script src="https://unpkg.com/mmp/build/mmp.min.js"></script>
<script>
    let myMap = mmp.create("map");
</script>

API Reference

The library uses an OOP paradigm and allows you to create multiple instances.

# mmp.create(id, [options])

Creates a mmp instance. Draw the mind map creating an svg element with the root node within the div element with id equal to the id string passed as parameter. You can optionally pass various options as the following example:

var map = mmp.create("map", {
    fontFamily: "Arial, Helvetica, sans-serif",
    centerOnResize: true,
    drag: false,
    zoom: false,
    defaultNode: {
        name: "Default node name",
        image: {
            src: "",
            size: 60
        },
        colors: {
            name: "#787878",
            background: "#f9f9f9",
            branch: "#577a96"
        },
        font: {
            size: 16,
            style: "normal",
            weight: "normal"
        },
        locked: true
    },
    rootNode: {
        name: "Default root node name",
        image: {
            src: "",
            size: 70
        },
        colors: {
            name: "#787878",
            background: "#f0f6f5",
            branch: ""
        },
        font: {
            size: 20,
            style: "normal",
            weight: "normal"
        }
    }
});

You can change these options later using the function map.updateOptions.

# mmp.version

Contains the version of the current used mmp library.

# map.remove()

Removes the map instance and the svg element of the mind map.

# map.new([map])

Creates a new empty mind map. If map is specified, creates a new mind map using mmp json structure. The map parameter must be a JSON-like object, here an example. The function map.exportAsJson is available to obtain the json of a map.

# map.zoomIn([duration])

Zooms in the mind map. If duration (int, milliseconds) is specified, sets the duration of the zoom animation.

# map.zoomOut([duration])

Zooms out the mind map. If duration (int, milliseconds) is specified, sets the duration of the zoom animation.

# map.updateOptions(property, value)

Updates the option property (string, "fontFamily", "centerOnResize", "drag", "zoom", "defaultNode", "rootNode") with the relative value passed as parameter.

# map.exportAsJson()

Returns a json with the structure of the current mind map.

# map.exportAsImage(callback, [type])

Calls the callback passing the URI of the map image as parameter. The type (string) optional parameter is the standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image.

# map.undo()

Allows to reverse the last one change.

# map.redo()

Repeats a previously undoed change.

# map.history()

Return all snapshots of the map.

# map.center([type], [duration])

Places the root node in the middle of the map and sets the zoom to the original state. If type (string, "position" or "zoom") is specified, updates only the location or updates only the zoom. If duration (int, milliseconds) is specified, sets the duration of the center animation.

# map.on(event, callback)

Calls the callback of the related event passing some parameters.

Events Callback parameters
create (nothing)
center (nothing)
undo (nothing)
redo (nothing)
exportJSON (nothing)
exportImage (nothing)
zoomIn (nothing)
zoomOut (nothing)
nodeSelect (node*)
nodeDeselect (nothing)
nodeUpdate (node*)
nodeCreate (node*)
nodeRemove (node*)

*node properties:

{
    id: string;
    parent: string;
    k: number;
    name: string;
    coordinates: {
        x: number;
        y: number;
    };
    image: {
        src: string;
        size: number;
    };
    colors: {
        name: string;
        background: string;
        branch: string
    };
    font: {
        size: number;
        style: string;
        weight: string
    };
    locked: boolean;
}

# map.addNode([properties], [id])

Adds a node in the map. The added node will be the child of the current selected node. If properties is specified, adds the node with those node properties. If id is not specified, adds the node as child of the selected node.

Properties:

{
    name: string;
    coordinates: {
        x: number;
        y: number;
    };
    image: {
        src: string;
        size: number;
    };
    colors: {
        name: string;
        background: string;
        branch: string
    };
    font: {
        size: number;
        style: string;
        weight: string
    };
    locked: boolean;
}

# map.selectNode([id])

Selects the node with the id (string) passed as parameter or the position ("left", "right", "down", "up"). If the id is not specified returns the current selected node.

# map.editNode()

Focus on the text of the selected node.

# map.deselectNode()

Deselects the selected node. The deselection is the same as selecting the root node without highlighting.

# map.updateNode(property, value, [graphic], [id])

Updates the node property (string, "name", "locked", "coordinates", "imageSrc", "imageSize", "backgroundColor", "branchColor", "fontWeight", "fontStyle", "fontSize", "nameColor") with the relative value passed as parameter. If graphic (boolean) is specified and is true, update only graphically the node. If id is not specified, update the selected node.

# map.removeNode([id])

Removes the selected node or if id (string) is specified, removes the node with the id passed as parameter.

# map.copyNode([id])

Copies a node with his children in the mmp clipboard. If id is not specified, copies the selected node.

# map.cutNode([id])

Removes and copy a node with his children in the mmp clipboard. If id is not specified, copies the selected node.

# map.pasteNode([id])

Paste the node of the mmp clipboard in the map. If id is not specified, paste the nodes of the mmp clipboard in the selected node.

# map.nodeChildren([id])

Return the children of the node specified with id. If id is not specified, return the children of the selected node.

File tree

After npm start
mmp
|
+--build
|  +--mmp.js
|  +--mmp.min.js
|
+--docs
|
+--example
|  +--img
|  +--app.js
|  +--layout.css
|  +--test.js
|
+--node_modules
|
+--src
|  +--map
|  +--utils
|  +--index.ts
|  +--typings.ts
|
+--index.html
|
+--LICENSE
+--README.md
+--package.json
+--rollup.config.js
+--tsconfig.json

Compatibility

Browser Version
Chromium 64.0.3282.140
Chrome 64.0.3282.167
Firefox 58.0.2
Opera 51.0.2830.34

Development

For a faster and more efficient development, some rules are used in the commits, in the branches and in the ECMAScript 2015 syntax.

# commits

  • Use this commit message format (angular style):

    [<type>]: <subject> <BLANK LINE> <body>

    where type must be one of the following:

    • feat: A new feature
    • fix: A bug fix
    • docs: Documentation only changes
    • style: Changes that do not affect the meaning of the code
    • refactor: A code change that neither fixes a bug nor adds a feature
    • test: Adding missing or correcting existing tests
    • chore: Changes to the build process or auxiliary tools and libraries such as documentation generation
    • update: Update of the library version or of the dependencies

and body must be should include the motivation for the change and contrast this with previous behavior (do not add body if the commit is trivial).

  • Use the imperative, present tense: "change" not "changed" nor "changes".
  • Don't capitalize first letter.
  • No dot (.) at the end.

# branches

  • There is a master branch, used only for release.
  • There is a dev branch, used to merge all sub dev branch.
  • Avoid long descriptive names for long-lived branches.
  • No CamelCase.
  • Use grouping tokens (words) at the beginning of your branch names (in a similar way to the type of commit).
  • Define and use short lead tokens to differentiate branches in a way that is meaningful to your workflow.
  • Use slashes to separate parts of your branch names.
  • Remove branch after merge if it is not important.

Examples:

git branch -b doc/README
git branch -b test/one-function
git branch -b feat/side-bar
git branch -b style/header

# es2015

  • Use let and const, not var.
  • Use Arrow Functions in place of function expressions when possible.
  • Use Arrow Functions whenever you need to preserve the lexical value of this.

Third-party libs

Library Authors or maintainers License Link
D3 Mike Bostock BSD-3-Clause https://d3js.org/

License

Contacts

Developer

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].