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
mport argparse | |
from streamlit_argparse import Form | |
from streamlit_folium import st_folium | |
import folium | |
from folium.plugins import Draw | |
import streamlit as st | |
import shlex | |
import jq | |
import json |
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
# get the supplied values and cast them | |
# to the correct type | |
value = getattr(result, action.dest) | |
match value: | |
case None: | |
pass | |
case [*_]: | |
value = [str(v) for v in value] | |
value = parser._get_values( | |
action, value |
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
import argparse | |
import streamlit as st | |
import shlex | |
from copy import deepcopy | |
from streamlit_tags import st_tags | |
class Form(): | |
def __init__( | |
self, | |
parser, |
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
realtime = Realtime(source, on_each_feature=on_each_feature, interval=10000).add_to(m) | |
realtime.on( | |
update=folium.JsCode( | |
""" | |
(e) => { | |
console.log('update ', e.target._map); | |
var map = e.target._map; | |
var realtime = e.target; | |
map.fitBounds(realtime.getBounds(), {maxZoom: 3}); | |
} |
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
import streamlit as st | |
from folium import JsCode | |
import streamlit_folium | |
import json | |
st.set_page_config( | |
page_title="streamlit-folium documentation: Draw Support", | |
page_icon=":pencil:", | |
layout="wide", | |
) |
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
https://docs.google.com/document/d/e/2PACX-1vSx0Ecngn28f8x2mzn55oZmlITHIcXvsce0xLYnpUmqQJgALVE7GM260Jq9iuEGC1pwG6z-3AtNXUus/pub |
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
import streamlit as st | |
>>from st_aggrid import AgGrid, JsCode, GridOptionsBuilder | |
>>import pandas as pd | |
>>df = pd.read_csv('https://raw.githubusercontent.com/fivethirtyeight/data/master/airline-safety/airline-safety.csv') | |
gb = GridOptionsBuilder.from_dataframe(df) | |
gb.configure_selection('single', pre_selected_rows=[], use_checkbox=False) | |
gridOptions = gb.build() | |
gridOptions['rowClassRules'] = { |
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
import streamlit as st | |
import streamlit.components.v1 as components | |
from streamlit_extras.row import row | |
from streamlit_extras.stylable_container import stylable_container | |
with st.sidebar: | |
st.markdown(""" | |
<style> | |
:root { | |
--header-height: 50px; |
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
import gtfs_realtime_OVapi_pb2 as ovapi | |
import requests | |
import urllib.request | |
from datetime import datetime | |
import time | |
from google.protobuf.json_format import MessageToJson, MessageToDict | |
from IPython import embed | |
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
cat track_bus699.geojson | jq '[([.geometry.coordinates, .properties.times] | transpose | .[] | {"coordinates": .[0], "start": .[1]}) as $features | del(.geometry.coordinates, .properties.times) | .geometry += {"coordinates": $features.coordinates} | .properties += {"start": $features.start, "end": ($features.start | (gsub("\\s"; "T") + "Z") as $date | $date | fromdate | . + 2)}] |
NewerOlder