From 0825ddd149da0667615b9001dfa782491791a0e0 Mon Sep 17 00:00:00 2001 From: Nathan Sullivan Date: Tue, 15 Sep 2020 16:47:41 +0000 Subject: [PATCH 1/3] Fixes for markers and css sizing issues --- time-zone-map-app/debug.log | 44 ++++++++++++++++++++++ time-zone-map-app/src/App.css | 13 ++++++- time-zone-map-app/src/core/map/MapChart.js | 38 ++++++++++++------- 3 files changed, 79 insertions(+), 16 deletions(-) create mode 100644 time-zone-map-app/debug.log diff --git a/time-zone-map-app/debug.log b/time-zone-map-app/debug.log new file mode 100644 index 0000000..19e4940 --- /dev/null +++ b/time-zone-map-app/debug.log @@ -0,0 +1,44 @@ +[0826/211440.521:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211440.522:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211440.522:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211440.522:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211440.522:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211440.522:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211440.522:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211440.522:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211440.522:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211440.522:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211440.523:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211556.607:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211556.608:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211556.608:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211556.608:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211556.608:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211556.608:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211556.608:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211556.608:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211556.608:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211556.608:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/211556.608:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232252.596:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232252.597:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232252.597:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232252.597:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232252.597:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232252.597:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232252.597:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232252.597:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232252.597:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232252.597:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232252.597:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232723.223:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232723.223:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232723.223:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232723.223:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232723.223:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232723.223:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232723.223:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232723.223:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232723.223:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232723.223:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0826/232723.223:ERROR:crash_report_database_win.cc(469)] failed to stat report diff --git a/time-zone-map-app/src/App.css b/time-zone-map-app/src/App.css index ee4010f..5704673 100644 --- a/time-zone-map-app/src/App.css +++ b/time-zone-map-app/src/App.css @@ -22,6 +22,7 @@ width: 100%; height: var(--header-height); line-height: var(--header-height); + font-size: 3.5vw; } select { @@ -53,14 +54,22 @@ select { .map-frame { width: 100%; height: 100%; + flex-basis: 75%; + flex-grow: 10; + padding-top: var(--header-height); +} +.mapSVG { + width: 100%; + height: 100vh; } - .sidebar { - width: 300px; + flex: auto; background: gray; height: 100vh; padding-top: var(--header-height); padding-left: 2vh; + max-width: 25%; + font-size: 3vw; } h3 { diff --git a/time-zone-map-app/src/core/map/MapChart.js b/time-zone-map-app/src/core/map/MapChart.js index fd715e4..9cb28b7 100644 --- a/time-zone-map-app/src/core/map/MapChart.js +++ b/time-zone-map-app/src/core/map/MapChart.js @@ -45,10 +45,15 @@ const rounded = num => { let dotSize = 1; const MapChart = ({ setTooltipContent, markers, team_stuff, current_team, markerScale = 1 }) => { + + + + + return ( { - - markers.map(({ name, coordinates, markerOffset }) => ( - - - - {name} - - - ))} + markers.map(({ name, coordinates, markerOffset }) => { + if(typeof team_stuff[current_team][name] !== 'undefined'){ + + + return ( + + + + {name} + + + ) + } + }) + } ); From eab0c9b3787665576af7041365a3e2d24f9c13dc Mon Sep 17 00:00:00 2001 From: Nathan Sullivan Date: Tue, 15 Sep 2020 17:07:35 +0000 Subject: [PATCH 2/3] more sizing fixes --- time-zone-map-app/src/App.css | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/time-zone-map-app/src/App.css b/time-zone-map-app/src/App.css index 5704673..d0608bd 100644 --- a/time-zone-map-app/src/App.css +++ b/time-zone-map-app/src/App.css @@ -22,7 +22,7 @@ width: 100%; height: var(--header-height); line-height: var(--header-height); - font-size: 3.5vw; + font-size: 2.25vw; } select { @@ -68,8 +68,19 @@ select { height: 100vh; padding-top: var(--header-height); padding-left: 2vh; - max-width: 25%; - font-size: 3vw; + padding-right:5px; + max-width: 15%; + font-size: 2vh; +} + +@media screen and (min-width: 1440px) { + .sidebar { + max-width: 10%; + font-size: 30px; + } + .header { + font-size: 30px; + } } h3 { From 361def46aaa4586052223aa016f3843dbb6dc044 Mon Sep 17 00:00:00 2001 From: Nathan Sullivan Date: Tue, 15 Sep 2020 20:53:16 +0000 Subject: [PATCH 3/3] Add 'All' as a team selection, more sizing fixes --- time-zone-map-app/src/App.css | 11 ++++- time-zone-map-app/src/App.js | 4 +- time-zone-map-app/src/core/map/MapChart.js | 40 ++++++++++++++++--- .../src/data/dropdown_options.json | 6 ++- 4 files changed, 50 insertions(+), 11 deletions(-) diff --git a/time-zone-map-app/src/App.css b/time-zone-map-app/src/App.css index d0608bd..a0ab094 100644 --- a/time-zone-map-app/src/App.css +++ b/time-zone-map-app/src/App.css @@ -22,11 +22,18 @@ width: 100%; height: var(--header-height); line-height: var(--header-height); - font-size: 2.25vw; + font-size: 3.25vh; } +.Header div{ + min-width: 25vw; +} + + select { - width: 300px; + min-width: 25vw; + max-width: 35vw; + font-size: 2vh; } .App-link { diff --git a/time-zone-map-app/src/App.js b/time-zone-map-app/src/App.js index 4a0bc72..edcd63c 100644 --- a/time-zone-map-app/src/App.js +++ b/time-zone-map-app/src/App.js @@ -10,7 +10,7 @@ import tz_markers from "./data/locations.json" import tz_count from "./data/timezone_count.json" import team_zones from "./data/team_timezones.json" -let currentTeam = "Programmer Team"; +let currentTeam = "All"; function updateFilter(value) { currentTeam = value; console.log(currentTeam); @@ -45,7 +45,7 @@ function parse_markers(mrkrs){ for(let i = 0; i < marks.length; i++){ nMarkers.push({coordinates: [marks[i][1].long,marks[i][1].lat], name: marks[i][1].tz_name, markerOffset: marks[i][1].utc_offset}); } - console.log(nMarkers); + return nMarkers; } var newMarkers = parse_markers(tz_markers); diff --git a/time-zone-map-app/src/core/map/MapChart.js b/time-zone-map-app/src/core/map/MapChart.js index 9cb28b7..1bc7e54 100644 --- a/time-zone-map-app/src/core/map/MapChart.js +++ b/time-zone-map-app/src/core/map/MapChart.js @@ -14,7 +14,7 @@ import { getTimezone } from 'countries-and-timezones'; import allStates from "../../data/allstates.json"; import topoJSON from "../../data/out_2.json" // import topoJSON from "../../data/timezones-topo2.json" - +import dropoptions from "../../data/dropdown_options.json"; import Color from "color" import timezoneColors from "../../data/timezone_colors.json" @@ -118,13 +118,32 @@ const MapChart = ({ setTooltipContent, markers, team_stuff, current_team, marker { + markers.map(({ name, coordinates, markerOffset }) => { - if(typeof team_stuff[current_team][name] !== 'undefined'){ + + + + let count = 0; + if(current_team === "All"){ + for(let i = 1; i < dropoptions.length; i++){ + + if(typeof team_stuff[dropoptions[i].text][name] !== 'undefined'){ + count += team_stuff[dropoptions[i].text][name]; + } + } + } else { + if(typeof team_stuff[current_team][name] !== 'undefined'){ + count = team_stuff[current_team][name]; + } + } + + + return ( - + ) - } - }) - } + + + } + + + + ) + } + + + + ); diff --git a/time-zone-map-app/src/data/dropdown_options.json b/time-zone-map-app/src/data/dropdown_options.json index d73b3ff..b50df31 100644 --- a/time-zone-map-app/src/data/dropdown_options.json +++ b/time-zone-map-app/src/data/dropdown_options.json @@ -1,4 +1,8 @@ [ + { + "value": "all", + "text": "All" + }, { "value": "Programmer Team", "text": "Programmer Team" @@ -39,4 +43,4 @@ "value": "Testing Team", "text": "Testing Team" } -] \ No newline at end of file +]