Public
Edited
Jan 21, 2023
Paused
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
ward_effect_array
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
ward_parameters@2.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
ttc = ttc_summarized
.map((d) =>
Array(d.count).fill({
SR_TYPE: d.SR_TYPE,
WARD: d.WARD,
time_to_completion: d.time_to_completion
})
)
.flat()
Insert cell
memdb
with days as (
select
SR_TYPE,
WARD,
cast(
julianday(CLOSED_DATE) - julianday(CREATED_DATE) as integer
) as time_to_completion
from
service_requests
where
created_date >= ${form.start_date.toISOString().substring(0, 10)}
AND created_date <= ${form.end_date.toISOString().substring(0, 10)}
and SR_TYPE IN (
'Abandoned Vehicle Complaint',
'Alley Pothole Complaint',
'Building Violation',
'Garbage Cart Maintenance',
'Graffiti Removal Request',
'Inspect Public Way Request',
'Pothole in Street Complaint',
'Rodent Baiting/Rat Complaint',
'Sewer Cleaning Inspection Request',
'Street Light Out Complaint',
'Traffic Signal Out Complaint',
'Tree Debris Clean-Up Request',
'Water On Street Complaint'
)
AND STATUS = 'Completed'
AND time_to_completion > 0
AND WARD IS NOT NULL
AND ORIGIN IN (
'Phone Call',
'Internet',
'Mobile Device',
'Alderman''s Office'
)
)
select
SR_TYPE,
WARD,
time_to_completion,
count(*) as count
from
days
group by
SR_TYPE,
WARD,
time_to_completion
Insert cell
memdb = new DatasetteClient("https://puddle.bunkum.us/_memory")
Insert cell
kde = require("fast-kde")
Insert cell
import { DatasetteClient } from "@fgregg/datasette-client-with-sql-cells-full-results-csv-stream"
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more