
Product
A New Overview in our Dashboard
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.
A Python package for creating graphical timelines of historical data using Plotly
Github: https://github.com/dh3968mlq/hdtimelines
Documentation: https://hdtimelines.readthedocs.io/en/
PyPI: https://pypi.org/project/hdtimelines/
An app that uese this package: https://timeflows.uk/
Some starter datasets (.csv): https://github.com/dh3968mlq/historicaldate-data
Uses the historicaldate package for dates:
In the timeline display:
# Sample code for a timeline of British monarchs and Prime Ministers
# The folder that historicaldate-data has been downloaded to...
dataroot = "/svol1/pishare/users/pi/repos/timelines2/historicaldate-data"
from hdtimelines import pltimeline
import pandas as pd
df1 = pd.read_csv(f"{dataroot}/data/History/Europe/English and British Monarchs.csv",
na_filter=False)
df2 = pd.read_csv(f"{dataroot}/data/History/Europe/British Prime Ministers.csv",
na_filter=False)
pltl = pltimeline.plTimeLine()
pltl.add_topic_from_df(df1, title="English and British Monarchs")
pltl.add_topic_from_df(df2, title="British Prime Ministers")
pltl.show() # Show in a browser, or...
pltl.write_html("/home/pi/example_timeline.html")
Dataframes passed to add_topic_from_df have one row per event or life, and specific column names. label must be present, together with either hdate or both of hdate_birth and hdate_death. All other columns are optional.
Column | Usage |
---|---|
label | Event label, appears on the timeline |
description | Extended description, used for hovertext |
hdate | Date of event, or start date if it is a persistent event |
hdate_end | End date of a persistent event |
hdate_birth | A person's birth date |
hdate_death | A person's date of death, defaults to alive if hdate_birth is present |
htext_end | Hover text linked to the marker drawn at hdate_end |
color (or colour) | Colour to draw the event or life |
url | hyperlink, active by clicking on the displayed label |
rank | An integer, use together with max_rank to control which rows are displayed |
min_xrange_years | An integer. The event is displayed only if the displayed date range is greater than min_xrange_years |
max_xrange_years | An integer. The event is displayed only if the displayed date range is less than or equal to max_xrange_years |
Date formats are described in detail at https://historicaldate.readthedocs.io/en/
In brief:
max_xrange_years, min_xrange_years
Released to PyPI and documentation on readthedocs
Split from historicaldate package (https://github.com/dh3968mlq/historicaldate)
add_event_set renamed to add_topic_from_df
add_event_set() now updates yaxes to fit the displayed data
New method plTimeLine().fit_xaxis(self, mindate=None, maxdate=None) that fits the X axis either to the data or to a specified range of dates
X axis date labels moved to top of display
Study range filtering added, parameters study_range_start and study_range_end of the add_event_set method. Event sets lying entirely outside the study range are not displayed.
Filtering on the value of a rank column in input data, parameter max_rank of the add_event_set method.
FAQs
A Python package for creating graphical timelines of historical events
We found that hdtimelines demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.