This repository has been archived by the owner on Oct 8, 2024. It is now read-only.
forked from ONSvisual/census-atlas
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tom Ridd <twridd@gmail.com>
- Loading branch information
1 parent
a778e66
commit 7b09d83
Showing
23 changed files
with
310 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
let ethnicity=[ | ||
{id:"black",value:"black",label:"Black"}, | ||
{id:"mixed",value:"mixed",label:"Mixed"}, | ||
{id:"white",value:"white",label:"White"}, | ||
{id:"other",value:"other",label:"Other"}, | ||
{id:"asian",value:"asian",label:"Asian"}, | ||
] | ||
let ethnicity = [ | ||
{ id: "black", value: "black", label: "Black" }, | ||
{ id: "mixed", value: "mixed", label: "Mixed" }, | ||
{ id: "white", value: "white", label: "White" }, | ||
{ id: "other", value: "other", label: "Other" }, | ||
{ id: "asian", value: "asian", label: "Asian" }, | ||
]; | ||
|
||
let cities=[ | ||
{ value: "none", label: "Please select", disabled:true}, | ||
let cities = [ | ||
{ value: "none", label: "Please select", disabled: true }, | ||
{ value: "london", label: "London" }, | ||
{ value: "bristol", label: "Bristol" }, | ||
{ value: "oxford", label: "Oxford" }, | ||
] | ||
]; | ||
|
||
let checkboxData=[ | ||
{id:"laptop", value:"laptop", label:"Laptop"}, | ||
{id:"mobile", value:"mobile", label:"Mobile"}, | ||
{id:"tablet", value:"tablet", label:"Tablet"}, | ||
] | ||
let checkboxData = [ | ||
{ id: "laptop", value: "laptop", label: "Laptop" }, | ||
{ id: "mobile", value: "mobile", label: "Mobile" }, | ||
{ id: "tablet", value: "tablet", label: "Tablet" }, | ||
]; | ||
|
||
export {ethnicity, cities, checkboxData} | ||
export { ethnicity, cities, checkboxData }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import {writable} from "svelte/store"; | ||
import { writable } from "svelte/store"; | ||
|
||
export let appIsInitialised = writable(false) | ||
export let appIsInitialised = writable(false); | ||
|
||
export const setInitialised = () => { | ||
appIsInitialised.set(true) | ||
} | ||
appIsInitialised.set(true); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
import {writable} from "svelte/store"; | ||
import { writable } from "svelte/store"; | ||
|
||
export let categoryDataIsLoaded = writable(false) | ||
export let tableIsLoaded = writable(false) | ||
export let categoryDataIsLoaded = writable(false); | ||
export let tableIsLoaded = writable(false); | ||
|
||
export let categoryData = {}; | ||
export let tableData = {}; | ||
export let breaks = []; | ||
|
||
export let categoryData = {} | ||
export let tableData = {} | ||
export let breaks = [] | ||
|
||
let dataService = null | ||
let dataService = null; | ||
|
||
export function initialiseCensusData(censusDataService) { | ||
dataService = censusDataService | ||
dataService = censusDataService; | ||
} | ||
|
||
export async function fetchCensusData(categoryCode, geographyCode) { | ||
categoryDataIsLoaded.set(false) | ||
categoryDataIsLoaded.set(false); | ||
|
||
// Do a simple data load | ||
let lsoaData = await dataService.fetchLsoaCategoryData(categoryCode) | ||
let higherData = await dataService.fetchHigherGeographyCategoryData(categoryCode) | ||
|
||
categoryData = {...lsoaData, ...higherData} | ||
breaks = await dataService.fetchLegendBreakpoints(categoryCode) | ||
categoryDataIsLoaded.set(true) | ||
} | ||
let lsoaData = await dataService.fetchLsoaCategoryData(categoryCode); | ||
let higherData = await dataService.fetchHigherGeographyCategoryData(categoryCode); | ||
|
||
categoryData = { ...lsoaData, ...higherData }; | ||
breaks = await dataService.fetchLegendBreakpoints(categoryCode); | ||
categoryDataIsLoaded.set(true); | ||
} |
Oops, something went wrong.