Skip to content

Grid view#98

Open
jzhu2017 wants to merge 3 commits into
developfrom
GridView
Open

Grid view#98
jzhu2017 wants to merge 3 commits into
developfrom
GridView

Conversation

@jzhu2017

Copy link
Copy Markdown
Contributor

Made a pannable and zoomable grid using d3!

Made a pannable/zoomable grid on D3
made code prettier

@chynu chynu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Haven't actually tested it on my computer though lol. I'm trusting you've tested it on yours .. ! Probably a good idea to try it out on ubuntu or another person's computer before you merge though.

Comment thread gui/index.html
<!-- basic imports (NEED TO BE LOCALIZED) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://pixijs.download/release/pixi.min.js"></script>
<script src="https://d3js.org/d3.v5.min.js"></script>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add a TODO to change this to be a local import.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In fact it may be a good idea to make an issue alongside this. We should have everything installed via npm.

Comment thread gui/index.html Outdated
<!-- basic imports -->
<!-- basic imports (NEED TO BE LOCALIZED) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://pixijs.download/release/pixi.min.js"></script>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If I'm not mistaken, we won't need Pixi.js if we've completely ported to the new gridview in d3.

Comment thread gui/static/js/components/gridview2.js Outdated
// this.setup(background);
// }

console.log("using white background");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please remove all console outputs, here and below.

Remember, whenever you make a PR you're planning on merging to develop, which is our "latest final working version." Which means we shouldn't have debugging output. Keep that for just testing.

Comment thread gui/static/js/main.js Outdated
import Scenarios from './components/scenarios.js';
import AddBot from './components/addbot.js';
import GridView from './components/gridview.js';
import GridView from './components/gridview2.js';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you're completely done with the old version of gridview, you can delete it. There's no need to have vestigial code in develop. (Once you've deleted it you can rename gridview2 to gridview, etc.)

Fixed changes

@chynu chynu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tested it on my computer and it works! Good job. :)

Two things:

  1. If there are no bots on the field, there shouldn't be a "find bots" button. Perhaps you should make another button called "return to origin" or "center" or something like that.
  2. Before you merge, please check this with the vision system and see if the units are reasonably matched to IRL because it'd be weird if one inch corresponded to 500 of whatever units they are. (Also yeah, what units are those?)

Also -- It's PR etiquette(?) to comment "Done" or something on each of the PR comments which requests for a change, alongside any updates if there need be any. FYI, from now on :>

Make sure to comment about calibrating with vision on the PR here, as well !

Comment thread gui/static/js/main.js
@@ -1,5 +1,7 @@
var React = require('react');
var ReactDOM = require('react-dom');
//var d3 = require('d3');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this no longer necessary? In which case you should just remove them instead of keeping the comments. If you're going to comment out something and it's not meant to be permanent, then you should delete it or at least add a TODO to take care of it in the line above the comment.

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.

2 participants