-
Notifications
You must be signed in to change notification settings - Fork 7
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
18 - use dot based map cont - Man #71
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not yet confident this is the right approach. I'd like to discuss two questions:
- My understanding was that we would give each dot an ID and store the relevant ID in the database. What is the plan for transitioning away from PX-based positioning?
- I would like to minimise the amount of interaction we have with
DotMap.js
. Is it possible to putDotMap
insideMyMap
? It was confusing to seeMyMap
imported but not referenced in the first 20,000 lines of the file.
client/src/components/DotMap.css
Outdated
@@ -0,0 +1,38 @@ | |||
/* dot map classes & ids */ | |||
|
|||
/* Cuba marker - can also use id #cuba */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need these comments?
client/src/components/DotMap.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a worringly large file, to the point where git is not able to display it for my review. Are there ways around editing this file?
How often does it need to be edited?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain the reasoning for putting the MyMap component inside the DotMap component vs vice versa?
server/db/build-rhythms.sql
Outdated
@@ -29,10 +29,10 @@ CREATE TABLE rhythms ( | |||
CONSTRAINT rhy_rhythm_code_fk FOREIGN KEY (rhythm_code_id) REFERENCES rhythm_codes (id) | |||
); | |||
|
|||
INSERT INTO rhythm_codes (rhythm_code, location, region, leftpx, toppx) VALUES('Rumba', 'Cuba', 'Caribbean', 570, 195); | |||
INSERT INTO rhythm_codes (rhythm_code, location, region, leftpx, toppx) VALUES('Gwo-Ka', 'Guadeloupe', 'Caribbean', 650, 180); | |||
INSERT INTO rhythm_codes (rhythm_code, location, region, leftpx, toppx) VALUES('Rumba', 'Cuba', 'Caribbean', 728.61, 742.22); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these still PX numbers?
client/src/pages/Home.css
Outdated
cursor: pointer; | ||
} | ||
|
||
button { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this for all buttons? or is there a specific button?
client/src/pages/Home.css
Outdated
background-color: rgb(255, 236, 167); | ||
} | ||
|
||
.menu > li > button { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this CSS belongs at the Home
level - it seems like it might need to style a menu component. What is it styling?
Add a readme to explain how to add a new location ID |
MyMap component is imported into DotMap
marker circles have radius of 20 and are plotted using centre of circle so offset is required to correct positioning
some dots were created using the ellipses shape, replaced with path equivalent to match rest of map
removed event listener
775273d
to
9c2c8f4
Compare
uses element id to find dot
map_id refers to the id of the dot inside the svg map
removed leftpx and toppx props
client/src/components/DotMap.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this, you have to know what keys are being used from rhythmCodeObject
- I'd prefer children
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The query selector and IDs approach looks good 👍
I would prefer that RhythmCodeIcon
stays in the MyMap
component as a child of DotMap
and we just pass children
to the DotMap
. It would mean nobody needs to look at or change DotMap
in the future. With the current code, people would need to look deep into that SVG file to figure out what props we pass to RhythmCodeIcon
. Basically I don't want anything imported or coded in DotMap
.
This solution is acceptable (as we are nearing the end of the project), but I strongly recommend this change
|
||
const dotSelector = document.querySelector(`#${map_id}`).outerHTML; | ||
const findxy = /(?!=d="m)([0-9]*.[0-9]*),([0-9]*.[0-9]*)/; | ||
const xyData = dotSelector.match(findxy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this approach
Naming Rules
Name your PR like this: ISSUENUMBER-TITLE-YOURNAME
Description
Related to
Make sure you include the issue number with a hash sign # so Github can link this PR to the right issue, like this:
Addresses #18
Checklist: