Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement reverse operator #20

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Zackhardtoname
Copy link

Suggest to close #19
Note that the other examples in the example directory probably should be corrected as well.

@Zackhardtoname
Copy link
Author

To use auto-refresh, install the Chrome extension LiveReload.

@Zackhardtoname Zackhardtoname changed the title Fix demo bug that no operators work Implement reverse operator Jul 29, 2019
@@ -557,6 +557,10 @@ $('#apply-operators-tooltip').click(() => {
case endpoint.operators.MERGE:
endpoint.designSpaceMerge(inputSpaces, outputSpace, tolerance);
break;

case endpoint.operators.REVERSE:
endpoint.designSpaceReverse(inputSpaces, outputSpace);
Copy link
Collaborator

@dany-fu dany-fu Jul 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment in endpoints.js

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change it.

try {
long startTime = System.nanoTime();

if (outputSpaceID == null) {
Copy link
Collaborator

@dany-fu dany-fu Jul 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should follow the conventions set by the other functions and throw error if outputSpaceID is null.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the output space is null, in the file DesignSpaceService.java, the functions usually choose the first element in the inputBranches as the output space. I think my charges here are consistent?

Copy link
Collaborator

@dany-fu dany-fu Aug 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that in the DesignSpaceService.java, but when you test on the UI, it will throw an error if the outputBranch is empty. But the change you made, where you put get .get(0) in knox.js, is inconsistent with the rest of the repo.

@dany-fu
Copy link
Collaborator

dany-fu commented Aug 2, 2019

I just realized there's nothing on the UI to test this? There should be a new element added to the Operators dropdown to actually use this functionality.

@Zackhardtoname
Copy link
Author

Zackhardtoname commented Aug 2, 2019

I just realized there's nothing on the UI to test this? There should be a new element added to the Operators dropdown to actually use this functionality.

The reverse operator is actually in the dropdown.

@dany-fu
Copy link
Collaborator

dany-fu commented Aug 2, 2019

Oh I see it now, I was on the wrong branch. I just tested this and it threw the error

image

Please test all your changes before making a commit.

@@ -557,6 +557,10 @@ $('#apply-operators-tooltip').click(() => {
case endpoint.operators.MERGE:
endpoint.designSpaceMerge(inputSpaces, outputSpace, tolerance);
break;

case endpoint.operators.REVERSE:
endpoint.designSpaceReverse(inputSpaces.get(0), outputSpace);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not valid javascript syntax

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see it now, I was on the wrong branch. I just tested this and it threw the error

image

Please test all your changes before making a commit.

Sorry! I was only looking at the output in the terminal. I will remember to check the webpage console as well.

@@ -559,7 +559,7 @@ $('#apply-operators-tooltip').click(() => {
break;

case endpoint.operators.REVERSE:
endpoint.designSpaceReverse(inputSpaces.get(0), outputSpace);
endpoint.designSpaceReverse(inputSpaces[0], outputSpace);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zack, you missed my other comment that this is inconsistent with the other functions. This code should be in the Java file, not here. Please squash these commits when you've fixed them.

Functionality: reverse the edges from the input design space.
Details:
Upon selecting reverse operator
	a. Delete input option
	b. Display some guidance

Close CIDARLAB#14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Demo Fails - "No enum constant knox.spring.data.neo4j.domain.Edge.Orientation.inline"
2 participants