Public
Edited
Sep 19, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
getYLabelText = (value) => {
const assetFullName = CHECKBOX_OPTIONS.find((co) => {
console.log({ coValue: co.value, value });
return co.value === value;
});

console.log(assetFullName);
if (assetFullName === -1 || assetFullName === undefined) {
return value;
}

if (showAssetName) {
return `${assetFullName.label} (${value})`;
}

return value;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
returns.verticalReturns
.filter((item) => item !== undefined)
.map((item) => item.data)
.forEach((data) => console.log(data))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
now = moment()
Insert cell
momentTimeInputFormat = (d) => d.format("HH:mm:ss")
Insert cell
momentDateInputFormat = (d) => d.format("YYYY-MM-DD")
Insert cell
startDateTime = `${startdate}T${starttime}`
Insert cell
endDateTime = `${enddate}T${endtime}`
Insert cell
unixStartDate = moment(startDateTime).unix()
Insert cell
unixEndDate = moment(endDateTime).unix()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
assetString.includes("CMI")
Insert cell
generateCheckboxOptions = () => {
return {
description: checkboxDescription,
options: generateCheckboxOptionsWithBold(false, true, CHECKBOX_OPTIONS),
value: getInitialValueForCheckbox()
// title: "test"
};
}
Insert cell
isCMIAsset = (asset) => CMI_ASSETS_SYMBOLS.includes(asset)
Insert cell
CHECKBOX_OPTIONS
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {
CORS_HEAD,
CRYPTO_OPTIONS,
pageCSS,
formElementsCSS,
generateCheckboxOptionsWithBold,
COINDESK_20,
cdCheckbox,
spinnerSTYLE,
CMI_ASSETS_SYMBOLS,
replaceCharsForNoCorsServer,
CHECKBOX_OPTIONS,
CMIAssetValuesBySector,
DACS_SECTORS,
getDaysBetweenDates
} from "@coindesk-research/cd-static-content-provider"
Insert cell
pageCSS
Insert cell
formElementsCSS
Insert cell
spinnerSTYLE

Insert cell
moment = require("moment")
Insert cell
import {
verticalReturnsData,
loadingStateFunction,
apiLoadingState
} from "@coindesk/asset-returns-provider"
Insert cell
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