Skip to content

Commit

Permalink
Neon.js v3.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
JRegimbal authored May 7, 2019
2 parents 55a8bdd + 91bb22c commit c227350
Show file tree
Hide file tree
Showing 162 changed files with 81,159 additions and 12,061 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/node_modules
/public/uploads/backup
/public/*.js
/public/*.rng
/public/img
/public/uploads/*
/views/*.png
/dist
.DS_Store
40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Contributing to Neon2

## Bugs

For reporting bugs to Neon2, please follow the process outlined on the
[issues wiki page](https://github.com/DDMAL/Neon2/wiki/Issues).

## Branches and Naming

When developing a feature or fixing a bug or doing anything more substantial than fixing a typo, it's best to
create a *feature* or *fix* branch addressing it and create a pull request rather than committing directly to
`develop` or `master`.

Feature branches introduce new features to Neon2. Fix branches fix something not working. If an issue exists
for the feature or branch, it is recommended to name the branch after the branch type followed by a forward slash
and the issue number. (e.g. if a branch is to introduce a feature described in issue number 20, the branch should
be named `feature/20`.)
If there is no issue number and for some reason it is best not to create one, replace the number with something
descriptive of what the branch is doing.

## Commits

Commit titles should be short while more should be elaborated on in the body if necessary.
Referencing an issue in a commit is not necessary, but recommended.

### Updates to Third-Party Code

In cases where the Verovio toolkit or another compiled feature **not** managed by yarn is updated,
include a reference to the commit it was compiled from in the commit body.
If the project is hosted on GitHub, the reference should be in the form of
`[user]/[repo]@[commit]` so a link can automatically be created. So a commit from the DDMAL verovio would be
`DDMAL/verovio@[commit]`.
If the project is hosted elsewhere, the short commit SHA-1 and where the repository can be found is enough.

## Pull Requests

Before opening a pull request, perform automated tests to ensure nothing has broken and manually test any fixes
or features. The pull request contents should reference the related issue, if any, and include an overview of
what was done.
Requesting a reviewer is not required, but recommended for anything that isn't straightforward.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Distributed Digital Music Archives and Libraries Lab
Copyright (c) 2018, 2019 Juliette Regimbal, Zoé McLennan, Andrew Tran

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
Neon2
Neon3
=====
[![Build_Status](https://travis-ci.org/DDMAL/Neon2.svg?branch=master)](https://travis-ci.org/DDMAL/Neon2)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard)

**N**eume **E**ditor **ON**line.


Neon2 is a browser-based music notation editor written in JavaScript using the Verovio music engraving library. The editor can be used to manipulate digitally encoded early musical scores in square-note notation.
Neon3 is a browser-based music notation editor written in JavaScript using the Verovio music engraving library. The editor can be used to manipulate digitally encoded early musical scores in square-note notation.


Neon2 is a re-write of [Neon.JS](https://github.com/DDMAL/Neon.js) using a modified version of [Verovio](https://github.com/DDMAL/verovio) to render MEI-Neume files according to the MEI 4.0 specifications.
Neon2 is a re-write of [Neon.JS](https://github.com/DDMAL/Neon.js) using a modified version of [Verovio](https://github.com/DDMAL/verovio) to render MEI-Neume files according to the MEI 4.0 specifications.

Requirements
------------
* [yarn](https://yarnpkg.com/en/docs/install):
* [yarn](https://yarnpkg.com/en/docs/install):
* `brew install yarn` on Mac

Setup
Expand All @@ -36,6 +37,12 @@ yarn start

4. Access the page at: <http://localhost:8080>.


Instructions
-----------

Neon.js has two main modes: viewer and editor. To learn how to use both, [read the instructions on our wiki.](https://github.com/DDMAL/Neon2/wiki/Instructions)

Test
----

Expand All @@ -48,3 +55,8 @@ brew install geckodriver
Then you can run the tests locally using `yarn test`. We use [jest](https://facebook.github.io/jest/) to script our tests.

*These tests require the server to be running on `localhost:8080`*

Verovio
-------

Verovio is present as an npm package under `src/verovio-dev` with the name `verovio-dev`. Its contents come from the `emscripten/npm-dev` folder in a Verovio project folder.
162 changes: 162 additions & 0 deletions doc/Color.js.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: Color.js</title>

<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

<h1 class="page-title">Source: Color.js</h1>






<section>
<article>
<pre class="prettyprint source linenums"><code>/** @module Color */

const $ = require('jquery');

/**
* Set a highlight by a different grouping. Either staff, syllable, or neume.
* @param {string} grouping - The grouping name.
*/
export function setGroupingHighlight (grouping) {
unsetGroupingHighlight();
if (grouping === 'staff') {
setStaffHighlight();
return;
}

let groups = Array.from($('.' + grouping));
for (var i = 0; i &lt; groups.length; i++) {
let groupColor = ColorPalette[i % ColorPalette.length];
if (!$(groups[i]).parents('.selected').length &amp;&amp; !$(groups[i]).hasClass('selected')) {
groups[i].setAttribute('fill', groupColor);
$(groups[i]).addClass('highlighted');
} else {
if (!$(groups[i]).hasClass('selected')) {
groups[i].setAttribute('fill', null);
} else {
groups[i].setAttribute('fill', '#d00');
}
$(groups[i]).removeClass('highlighted');
}
}
}

/**
* Unset highlight for all grouping types
*/
export function unsetGroupingHighlight () {
unsetStaffHighlight();
let highlighted = Array.from($('.highlighted').filter((index, elem) => { return !$(elem.parentElement).hasClass('selected'); }));
highlighted.forEach(elem => {
elem.setAttribute('fill', null);
$(elem).removeClass('highlighted');
});
}

/**
* Highlight each staff a different color.
*/
export function setStaffHighlight () {
let staves = Array.from(document.getElementsByClassName('staff'));
for (var i = 0; i &lt; staves.length; i++) {
let staffColor = ColorPalette[i % ColorPalette.length];
highlight(staves[i], staffColor);
}
}

/**
* Remove the highlight from each staff.
*/
export function unsetStaffHighlight () {
unhighlight('.staff');
}

/**
* Highlight a staff a certain color.
* @param {SVGSVGElement} staff - The staff's SVG element.
* @param {string} color - The color to highlight the staff.
*/
export function highlight (staff, color) {
let children = Array.from($('#' + staff.id).children());
children.forEach(child => {
if (child.tagName === 'path') {
child.setAttribute('stroke', color);
} else {
child.setAttribute('fill', color);
}
$(child).addClass('highlighted');
});
}

/**
* Remove the highlight from a staff.
* @param {(SVGSVGElement|string)} staff - The staff's SVG element or a JQuery selector.
*/
export function unhighlight (staff) {
let children = Array.from($(staff).filter(':not(.selected)').children('.highlighted'));
children.forEach(elem => {
if (elem.tagName === 'path') {
elem.setAttribute('stroke', '#000000');
} else {
elem.removeAttribute('fill');
}
});
$(staff).filter(':not(.selected)').children('.highlighted').removeClass('highlighted');
}

/**
* Color palette from Figure 2 (Colors optimized for color-blind
* individuals) from
* ["Points of view: Color blindness" by Bang Wong published in Nature Methods volume 8 on 27 May 2011]{@link https://www.nature.com/articles/nmeth.1618?WT.ec_id=NMETH-201106}
* @type {string[]}
*/
const ColorPalette = [
// "rgb(0,0,0)",
'rgb(230, 159, 0)',
'rgb(86, 180, 233)',
'rgb(0, 158, 115)',
'rgb(240, 228, 66)',
'rgb(0, 114, 178)',
'rgb(213, 94, 0)',
'rgb(204, 121, 167)'
];
</code></pre>
</article>
</section>




</div>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Color.html">Color</a></li><li><a href="module-Compatibility.html">Compatibility</a></li><li><a href="module-Contents.html">Contents</a></li><li><a href="module-Controls.html">Controls</a></li><li><a href="module-Cursor.html">Cursor</a></li><li><a href="module-Grouping.html">Grouping</a></li><li><a href="module-Notification.html">Notification</a></li><li><a href="module-ResizeStaff.html">ResizeStaff</a></li><li><a href="module-Select.html">Select</a></li><li><a href="module-SelectOptions.html">SelectOptions</a></li><li><a href="module-Text.html">Text</a></li><li><a href="module-Warnings.html">Warnings</a></li><li><a href="module-Zoom.html">Zoom</a></li></ul><h3>Classes</h3><ul><li><a href="DragHandler.html">DragHandler</a></li><li><a href="EditMode.html">EditMode</a></li><li><a href="InfoBox.html">InfoBox</a></li><li><a href="InsertHandler.html">InsertHandler</a></li><li><a href="module-Notification-Notification.html">Notification</a></li><li><a href="module-ResizeStaff-Resize.html">Resize</a></li><li><a href="module-Select.ClickSelect.html">ClickSelect</a></li><li><a href="module-Select.DragSelect.html">DragSelect</a></li><li><a href="module-Zoom.ViewBox.html">ViewBox</a></li><li><a href="module-Zoom-ZoomHandler.html">ZoomHandler</a></li><li><a href="NeonCore.html">NeonCore</a></li><li><a href="NeonView.html">NeonView</a></li><li><a href="SplitHandler.html">SplitHandler</a></li></ul>
</nav>

<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Apr 25 2019 17:27:40 GMT-0400 (GMT-04:00)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>
Loading

0 comments on commit c227350

Please sign in to comment.