Skip to content

Commit

Permalink
Feature/bend links (#91)
Browse files Browse the repository at this point in the history
* Add tsconfig.json to project

* Add link.helper and link.const

* Add link.type config allow link to optionally bend

* Add docs:lint to lint task

* Bump documentation to 6.2.0

* Small tweaks in documentation

* Implement strict eslint rules for jsdoc

* Update spanshot tests due to link structural change

* Update link.po and graph spec updating lines selector

* Small renaming in graph.renderer

* Add some sample gifs to complement docs

* Bump jest

* Add test for link.helper. Update snapshots

* Small refactor in link.helper

* Update package-lock
  • Loading branch information
danielcaldas authored Jul 25, 2018
1 parent df2e20f commit 6e1201c
Show file tree
Hide file tree
Showing 19 changed files with 2,256 additions and 1,717 deletions.
74 changes: 44 additions & 30 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,50 @@
module.exports = {
"extends": [
"eslint:recommended"
],
"globals": {
"document": true,
"Reflect": true,
"window": true
extends: ['eslint:recommended'],
globals: {
document: true,
Reflect: true,
window: true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"jsx": true
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 6,
ecmaFeatures: {
jsx: true
}
},
"plugins": [
"standard",
"promise",
"react"
],
"rules": {
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"camelcase": "error",
"keyword-spacing": "error",
"max-len": ["error", 120, 4, { "ignoreComments": true }],
"max-lines": ["error", {"max": 400, "skipComments": true}],
"newline-after-var": ["error", "always"],
"no-nested-ternary": "error",
"no-useless-constructor": "error",
"semi": "error",
"require-jsdoc": "error",
"valid-jsdoc": "error"
plugins: ['standard', 'promise', 'react'],
rules: {
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
camelcase: 'error',
'keyword-spacing': 'error',
'max-len': ['error', 120, 4, { ignoreComments: true }],
'max-lines': ['error', { max: 400, skipComments: true }],
'newline-after-var': ['error', 'always'],
'no-nested-ternary': 'error',
'no-useless-constructor': 'error',
semi: 'error',
'require-jsdoc': 'error',
'valid-jsdoc': [
'error',
{
prefer: {
arg: 'param',
argument: 'param',
class: 'constructor',
return: 'returns',
virtual: 'abstract'
},
preferType: {
Boolean: 'boolean',
Number: 'number',
object: 'Object',
String: 'string',
Function: 'Function'
},
requireReturn: true,
requireReturnType: true
}
]
}
};
4 changes: 2 additions & 2 deletions cypress/integration/graph.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('[rd3g-graph] graph tests', function() {

it('nodes props modifications should be reflected in the graph', function() {
cy.get('text').should('have.length', 14);
cy.get('line').should('be.visible');
cy.get('path[class="link"]').should('be.visible');

this.sandboxPO.addNode();
this.sandboxPO.addNode();
Expand Down Expand Up @@ -104,7 +104,7 @@ describe('[rd3g-graph] graph tests', function() {
this.sandboxPO.removeNode();

cy.get('text').should('have.length', 14);
cy.get('line').should('be.visible');
cy.get('path[class="link"]').should('be.visible');
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/page-objects/link.po.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
function LinkPO(index) {
this.index = index;

this.getLine = () => cy.get('line').then(lines => lines[this.index]);
this.getLine = () => cy.get('path[class="link"]').then(lines => lines[this.index]);
this.getStyle = () => this.getLine().invoke('attr', 'style');
this.shouldHaveColor = color => this.getStyle().should('contain', `stroke: ${color};`);
this.shouldHaveOpacity = opacity => this.getStyle().should('contain', `opacity: ${opacity};`);
Expand Down
Binary file added docs/rd3g-bend.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/rd3g-collapsible.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/rd3g-custom-svg.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6e1201c

Please sign in to comment.