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

Kallewesterling/issue2 #177

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
da771af
scroll adjust works but ticks missing
edwardchalstrey1 Jun 27, 2024
18d433e
yearTickmarkValues above slider
edwardchalstrey1 Jul 1, 2024
ea5071d
400% width
edwardchalstrey1 Jul 1, 2024
e471cca
adjust scroll on every plot polities
edwardchalstrey1 Jul 1, 2024
8400e46
increase tickmarks to 100
edwardchalstrey1 Jul 1, 2024
188d030
ensure slider value never off screen
edwardchalstrey1 Jul 1, 2024
b1f4ca7
massive year
edwardchalstrey1 Jul 1, 2024
e81db0c
move year controls to bottom
edwardchalstrey1 Jul 1, 2024
b42797a
switch font
edwardchalstrey1 Jul 1, 2024
2c60039
add increment
edwardchalstrey1 Jul 1, 2024
c80889f
increment controls play rate
edwardchalstrey1 Jul 1, 2024
944dcce
add start and end buttons
edwardchalstrey1 Jul 1, 2024
a025efe
adjust date percent left
edwardchalstrey1 Jul 1, 2024
e8caba2
swap order of play rate and animation
edwardchalstrey1 Jul 2, 2024
123f2ac
use 80 ticks for world map
edwardchalstrey1 Jul 2, 2024
fd45160
reposition date further from left
edwardchalstrey1 Jul 2, 2024
6ce53b0
fit controls neatly
edwardchalstrey1 Jul 2, 2024
3188a2b
add white background date
edwardchalstrey1 Jul 2, 2024
133bd76
move sliderDate up
edwardchalstrey1 Jul 2, 2024
1cac35e
consistent transparancy
edwardchalstrey1 Jul 2, 2024
424efc0
consistent background colours
edwardchalstrey1 Jul 2, 2024
5de1940
adjust positioning
edwardchalstrey1 Jul 2, 2024
7b10b25
add popup to side panel
edwardchalstrey1 Jul 2, 2024
642b8d2
add link to polity page
edwardchalstrey1 Jul 2, 2024
2dd47f2
fit popup
edwardchalstrey1 Jul 2, 2024
83f7985
adjust popup position and padding
edwardchalstrey1 Jul 2, 2024
0eacfac
add coloured borders to panel
edwardchalstrey1 Jul 2, 2024
34f3b14
round edges
edwardchalstrey1 Jul 2, 2024
99d618f
put popup in top left of map
edwardchalstrey1 Jul 2, 2024
2a69a2a
accent-color: teal
edwardchalstrey1 Jul 2, 2024
650a4a0
use proper colour for basemap
edwardchalstrey1 Jul 2, 2024
d4590e1
combine to single click func
edwardchalstrey1 Jul 2, 2024
62f1b35
add clear selection button
edwardchalstrey1 Jul 2, 2024
0966231
turn off personal union clicking
edwardchalstrey1 Jul 2, 2024
ba6a2b1
clear selection on variable dropdown
edwardchalstrey1 Jul 2, 2024
d40a61a
add initial polity to popup
edwardchalstrey1 Jul 2, 2024
9656ecf
remove start and end buttons from polity map
edwardchalstrey1 Jul 2, 2024
604408c
reorder buttons
edwardchalstrey1 Jul 2, 2024
d3ac4e5
accent-color: teal;
edwardchalstrey1 Jul 2, 2024
af99c13
Merge pull request #5 from Seshat-Global-History-Databank/scrollable-…
edwardchalstrey1 Jul 2, 2024
bc2967a
Fixing up unnecessary `docs` import causing docs rendering issues
kallewesterling Jul 4, 2024
7ddd3b1
Create issue templates
kallewesterling Jul 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: "🐛 Bug Report"
description: Create a new ticket for a bug.
title: "🐛 [BUG] - <title>"
labels: [
"bug"
]
body:
- type: textarea
id: description
attributes:
label: "Description"
description: Please enter an explicit description of your issue
placeholder: Short and explicit description of your incident...
validations:
required: true
# - type: input
# id: reprod-url
# attributes:
# label: "Reproduction URL"
# description: Please enter your GitHub URL to provide a reproduction of the issue
# placeholder: ex. https://github.com/USERNAME/REPO-NAME
# validations:
# required: true
- type: textarea
id: reprod
attributes:
label: "Reproduction steps"
description: Please enter an explicit description of your issue
value: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
render: bash
validations:
required: true
- type: textarea
id: screenshot
attributes:
label: "Screenshots"
description: If applicable, add screenshots to help explain your problem.
value: |
![DESCRIPTION](LINK.png)
render: bash
validations:
required: false
- type: textarea
id: logs
attributes:
label: "Logs"
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: bash
validations:
required: false
- type: dropdown
id: browsers
attributes:
label: "Browsers"
description: What browsers are you seeing the problem on ?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- Opera
validations:
required: false
- type: dropdown
id: os
attributes:
label: "OS"
description: What is the impacted environment ?
multiple: true
options:
- Windows
- Linux
- Mac
validations:
required: false
53 changes: 53 additions & 0 deletions .github/ISSUE_TEMPLATE/DOCS_IMPROVEMENT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Documentation Improvement

description: Suggest changes or improvements to the documentation.

title: "📚 [Documentation] <title>"

labels: ["documentation"]

body:
- type: markdown
attributes:
value: |
## Documentation Improvement Request

Thank you for taking the time to help improve our documentation! Please provide the details of your suggestion below.

### Example

**Section of Documentation**: Installation Instructions

**Description of Improvement**: Add a troubleshooting guide for common installation issues on Windows.

**Benefits of Improvement**: Helps users resolve installation problems quickly, reducing frustration and support requests.

**Additional Context**: Based on frequent questions from users in the community forums.

- type: input
id: section
attributes:
label: Section of Documentation
description: Which section of the documentation does this improvement pertain to?
placeholder: "e.g., Installation Instructions, User Guide, API Reference"

- type: textarea
id: description
attributes:
label: Description of Improvement
description: Provide a detailed description of the improvement you are suggesting.
placeholder: "Describe the change or addition you would like to see."

- type: input
id: benefits
attributes:
label: Benefits of Improvement
description: Explain how this improvement will benefit users.
placeholder: "e.g., clearer instructions, easier navigation, more comprehensive coverage"

- type: textarea
id: context
attributes:
label: Additional Context
description: Add any other context or information related to this improvement request.
placeholder: "Include any relevant links, examples, or references."
97 changes: 97 additions & 0 deletions .github/ISSUE_TEMPLATE/USER_STORY.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Feature request
description: To create a new feature request, we ask that you write a user story.
title: "👤 [User Story]: "
labels: ["feature-request"]
body:
- type: markdown
attributes:
value: |
Thank you for contributing an idea for a new feature! Please fill out the user story details below to help us understand your vision for the new feature.

- type: input
id: role
attributes:
label: Role
description: Who is the user for this story?
placeholder: ex. As a [Admin]
validations:
required: true

- type: input
id: feature
attributes:
label: Desired Feature
description: What is the feature you would like to have?
placeholder: I want to [feature description]
validations:
required: true

- type: input
id: benefit
attributes:
label: Benefit
description: What is the benefit of this feature?
placeholder: So that I can [benefit description]
validations:
required: true

- type: textarea
id: acceptance-criteria
attributes:
label: Acceptance Criteria
description:
Please describe the conditions that must be met for this story to be
considered complete.
placeholder: |
**GIVEN** [precondition]
**AND** [another precondition if necessary]
**WHEN** [action taken by the user]
**THEN** [expected outcome]
**AND** [another outcome if necessary]
validations:
required: true

- type: textarea
id: dependencies
attributes:
label: Dependencies
description: Are there any other tasks that need to be completed first?
placeholder: |
- [ ] Dependency 1 (include issue link)
- [ ] Dependency 2 (include issue link)
validations:
required: false

- type: textarea
id: technical-notes
attributes:
label: Technical Notes
description:
Any technical notes, potential challenges, or architectural
considerations for implementation?
placeholder: |
- Note 1
- Note 2
validations:
required: false

- type: checkboxes
id: definition-of-done
attributes:
label: Definition of Done
description:
Please confirm the following are completed before this story can be
considered done.
options:
- label: The feature fulfills all acceptance criteria.
- label: The code is reviewed and meets team coding standards.
- label: All unit, integration, and end-to-end tests are passed.
- label: The feature meets accessibility standards set for the project.
- label:
The code passes the CI/CD pipeline quality controls (style and
linting).
- label: The feature is merged into the main branch.
- label: The feature is deployed and functional in the QA environment.
- label:
The feature was demonstrated to the team and accepted by the product
owner.
5 changes: 0 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
sys.path.insert(0, os.path.abspath('../..'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'seshat.settings.base'

import sphinx_rtd_theme

import seshat

Expand All @@ -36,7 +35,6 @@
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.doctest",
# "sphinx_rtd_theme",
"myst_parser",
"autoapi.extension",
"sphinx_copybutton",
Expand Down Expand Up @@ -106,10 +104,7 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "sphinx_book_theme"

# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_static_path = ["_static"]

html_theme_options = {
"use_download_button": True,
}
Expand Down
72 changes: 35 additions & 37 deletions seshat/apps/core/static/core/js/map_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,40 @@ function updateSliderOutput() {
}

function adjustSliderUp() {
slider.value = Number(slider.value) + 1;
increment = Number(document.getElementById('increment').value)
slider.value = Number(slider.value) + increment;
enterYearInput.value = slider.value; // Sync enterYear input with dateSlide value
updateSliderOutput(); // Update the displayed year
plotPolities(); // This function is defined differently in the world_map and polity_map templates
}

function adjustSliderDown() {
slider.value = Number(slider.value) - 1;
increment = Number(document.getElementById('increment').value)
slider.value = Number(slider.value) - increment;
enterYearInput.value = slider.value; // Sync enterYear input with dateSlide value
updateSliderOutput(); // Update the displayed year
plotPolities(); // This function is defined differently in the world_map and polity_map templates
}

function updateSliderValue(value) {
var sliderValue = document.getElementById('sliderValue');
switch (value) {
case '1':
sliderValue.textContent = '1 y/s'; // See the values in the startPlay function below
break;
case '2':
sliderValue.textContent = '5 y/s';
break;
case '3':
sliderValue.textContent = '20 y/s';
break;
case '4':
sliderValue.textContent = '50 y/s';
break;
case '5':
sliderValue.textContent = '100 y/s';
break;
}
function adjustSliderStartYear() {
slider.value = slider.min;
enterYearInput.value = slider.value; // Sync enterYear input with dateSlide value
updateSliderOutput(); // Update the displayed year
plotPolities(); // This function is defined differently in the world_map and polity_map templates
}

function adjustSliderEndYear() {
slider.value = slider.max;
enterYearInput.value = slider.value; // Sync enterYear input with dateSlide value
updateSliderOutput(); // Update the displayed year
plotPolities(); // This function is defined differently in the world_map and polity_map templates
}

function playRateValue() {
console.log('called')
var increment = Number(document.getElementById('increment').value);
var playRate = document.getElementById('playRate')
playRate.textContent = increment + ' y/s';
plotPolities();
}

Expand Down Expand Up @@ -86,21 +88,9 @@ function setSliderTicks (tickYears) {

function startPlay() {
stopPlay(); // Clear existing interval before starting a new one
var increment = Number(document.getElementById('increment').value);

var animationSpeed = parseFloat(playRateInput.value);
if (animationSpeed == 1) {
var yearsPerSecond = 1;
} else if (animationSpeed == 2) {
var yearsPerSecond = 5;
} else if (animationSpeed == 3) {
var yearsPerSecond = 20;
} else if (animationSpeed == 4) {
var yearsPerSecond = 50;
} else if (animationSpeed == 5) {
var yearsPerSecond = 100;
}

var milliseconds = 1 / (yearsPerSecond / 1000);
var milliseconds = 1 / (increment / 1000);

playInterval = setInterval(function () {
// Increment the slider value by 1
Expand Down Expand Up @@ -167,7 +157,7 @@ function switchBaseMap() {
baseShapeData.forEach(function (shape) {
// Ensure the geometry is not empty
if (shape.geometry && shape.geometry.type) {
gadmFillColour = 'white'; // Default fill colour
gadmFillColour = "#fffdf2"; // Default fill colour
if (shape.country.toLowerCase().includes('sea')) {
gadmFillColour = 'lightblue';
}
Expand Down Expand Up @@ -351,7 +341,7 @@ function updateLegend() {
colorBox.style.display = 'inline-block';
colorBox.style.width = '20px';
colorBox.style.height = '20px';
colorBox.style.backgroundColor = 'white';
colorBox.style.backgroundColor = '#fffdf2';
colorBox.style.border = '1px solid black';
colorBox.style.marginRight = '10px';

Expand All @@ -362,6 +352,14 @@ function updateLegend() {
}
}

function clearSelection() {
document.getElementById('popup').innerHTML = '';
shapesData.forEach(function (shape) {
shape['weight'] = 0;
});
plotPolities();
}

function updateCategoricalVariableSelection(variable){
var dropdown = document.getElementById('chooseCategoricalVariableSelection');
dropdown.innerHTML = '';
Expand Down
Loading
Loading