Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/screenshots #79

Merged
merged 4 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"version": "3.36.1",
"menu": [
{
"name": "Screenshots",
"url": "/screenshots/"
},
{
"name": "Examples",
"url": "/examples/"
Expand Down
126 changes: 126 additions & 0 deletions pages/screenshots/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import React from "react";
import styled from "styled-components";
import { readFileSync } from "fs";
import matter from "gray-matter";
import getAllMdFilesInDir from "@utils/getAllMdFilesInDir";
import Image from "@components/Image/Image";
import getOptimizedImageAttributes, {
ImageProps,
} from "@utils/images/getOptimizedImageAttributes";
import path from "path";
import MainLayout from "@components/UiKit/MainLayout";
import device from "@styles/utils/breakpoints";
import ImageGallery from "@components/ImageGallery/ImageGallery";
import sortByWeight from "@utils/sortByWeight";

interface IScreenshots {
title: string;
image: ImageProps;
thumbnailImage: ImageProps;
weight: number;
}

export async function getStaticProps() {
const examplesMdFiles = getAllMdFilesInDir("public/screenshots");

const screenshots: IScreenshots[] = [];

for (const file of examplesMdFiles) {
const dirInPublic = path.dirname(path.relative("public", file));
const mdFile = readFileSync(file, "utf-8");
const { data: frontmatter } = matter(mdFile);

screenshots.push({
...frontmatter,
image: getOptimizedImageAttributes(
path.join(path.sep, dirInPublic, frontmatter.image),
) as ImageProps,
thumbnailImage: getOptimizedImageAttributes(
path.join(path.sep, dirInPublic, frontmatter.thumbnailImage),
) as ImageProps,
} as IScreenshots);
}

return {
props: {
screenshots: sortByWeight(screenshots),
},
};
}

export default function Examples({
screenshots,
}: {
screenshots: IScreenshots[];
}) {
return (
<MainLayout title="Screenshots">
<ImageGallery selector="[data-gallery]">
<StyledListWrapper>
{screenshots.map(({ title, image, thumbnailImage }) => (
<Item key={title}>
<a href={image.src} data-gallery>
<Image
key={thumbnailImage.src}
{...thumbnailImage}
alt={title}
/>
</a>

<h2>{title}</h2>
</Item>
))}
</StyledListWrapper>
</ImageGallery>
</MainLayout>
);
}

const StyledListWrapper = styled.ul`
display: grid;
gap: 62px;
grid-template-columns: auto auto auto;
padding-top: 30px;
border-top: 1px solid ${({ theme }) => theme.borderColor};

@media ${device.M} {
grid-template-columns: auto auto;
gap: 48px;
}

@media ${device.XS} {
grid-template-columns: auto;
gap: 48px;
}
`;

const Item = styled.li`
display: flex;
flex-direction: column;
gap: 12px;

h2 {
text-align: center;
font-weight: 600;
margin-top: auto;
font-size: 18px;

@media ${device.M} {
font-size: 16px;
grid-template-columns: auto auto;
gap: 48px;
}
}

img {
width: 100%;
}
`;

const ItemImage = styled.div`
flex: 30;

img {
width: 100%;
}
`;
Binary file added public/screenshots/box-plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/screenshots/box-plot.thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions public/screenshots/box_plot_displays_basic_statistics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "box-plot.png"
thumbnailImage: "box-plot.thumb.png"
title: "Box plot displays basic statistics of attributes."
weight: "60"
---
Binary file added public/screenshots/calibration-plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/screenshots/calibration-plot.thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/screenshots/cn2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/screenshots/cn2.thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions public/screenshots/cn2_rule_induction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "cn2.png"
thumbnailImage: "cn2.thumb.png"
title: "CN2 rule induction."
weight: "250"
---
Binary file added public/screenshots/concatenate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/screenshots/concatenate.thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions public/screenshots/cross_validated_calibration_plot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "calibration-plot.png"
thumbnailImage: "calibration-plot.thumb.png"
title: "Cross-validated calibration plot."
weight: "160"
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "evaluation.png"
thumbnailImage: "evaluation.thumb.png"
title: "Cross-validated calibration plot."
weight: "200"
---
6 changes: 6 additions & 0 deletions public/screenshots/data_can_contain_references_to_images.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "image-viewer.png"
thumbnailImage: "image-viewer.thumb.png"
title: "Data can contain references to images."
weight: "100"
---
6 changes: 6 additions & 0 deletions public/screenshots/data_preprocessing_embedded_within.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "pca-evaluation.png"
thumbnailImage: "pca-evaluation.thumb.png"
title: "Data preprocessing embedded within a learning algorithm."
weight: "170"
---
6 changes: 6 additions & 0 deletions public/screenshots/data_selection_in_scatter_plot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "explorative-analysis.png"
thumbnailImage: "explorative-analysis.thumb.png"
title: "Data selection in Scatter Plot is visualised in a Box Plot."
weight: "30"
---
Binary file added public/screenshots/evaluation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/screenshots/evaluation.thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/screenshots/explorative-analysis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/screenshots/explorative-analysis.thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "tree-explorative.png"
thumbnailImage: "tree-explorative.thumb.png"
title: "Explorative analysis with classification trees."
weight: "90"
---
6 changes: 6 additions & 0 deletions public/screenshots/feature_scoring_for_finding_interesting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "rank.png"
thumbnailImage: "rank.thumb.png"
title: "Feature scoring for finding interesting data projections."
weight: "180"
---
Binary file added public/screenshots/file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/screenshots/file.thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "venn-misclassified.png"
thumbnailImage: "venn-misclassified.thumb.png"
title: "Finding common misclassifications of three predictive models."
weight: "220"
---
Binary file added public/screenshots/gradient-descent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/screenshots/gradient-descent.thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/screenshots/heat-map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/screenshots/heat-map.thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions public/screenshots/heatmap_visualisation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "heat-map.png"
thumbnailImage: "heat-map.thumb.png"
title: "Heatmap visualisation."
weight: "80"
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "hierarchical-clustering.png"
thumbnailImage: "hierarchical-clustering.thumb.png"
title: "Hierarchial clustering supports interactive cluster selection."
weight: "110"
---
Binary file added public/screenshots/hierarchical-clustering.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/screenshots/image-analytics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/screenshots/image-analytics.thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/screenshots/image-viewer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/screenshots/image-viewer.thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "image-analytics.png"
thumbnailImage: "image-analytics.thumb.png"
title: "Image analytics with deep-network embedding."
weight: "300"
---
6 changes: 6 additions & 0 deletions public/screenshots/interactive_gradient_descent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "gradient-descent.png"
thumbnailImage: "gradient-descent.thumb.png"
title: "Interactive gradient descent."
weight: "270"
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "silhouette.png"
thumbnailImage: "silhouette.thumb.png"
title: "Intersection of misclassified data and data with low silhouette score."
weight: "240"
---
6 changes: 6 additions & 0 deletions public/screenshots/join_two_data_sets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "concatenate.png"
thumbnailImage: "concatenate.thumb.png"
title: "Join two data sets."
weight: "50"
---
Binary file added public/screenshots/k-means.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/screenshots/k-means.thumb.png
6 changes: 6 additions & 0 deletions public/screenshots/load_and_edit_your_data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "file.png"
thumbnailImage: "file.thumb.png"
title: "Load and edit your data in the File widget."
weight: "10"
---
Binary file added public/screenshots/mds.png
Binary file added public/screenshots/mds.thumb.png
Binary file added public/screenshots/misclassifications.png
Binary file added public/screenshots/misclassifications.thumb.png
Binary file added public/screenshots/model-based-scoring.png
Binary file added public/screenshots/model-based-scoring.thumb.png
6 changes: 6 additions & 0 deletions public/screenshots/model_based_feature_scoring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "model-based-scoring.png"
thumbnailImage: "model-based-scoring.thumb.png"
title: "Model-based feature scoring."
weight: "190"
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "test-train.png"
thumbnailImage: "test-train.thumb.png"
title: "Model testing and scoring on a separate test data set."
weight: "230"
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "mds.png"
thumbnailImage: "mds.thumb.png"
title: "Multidimensional scaling of Zoo data set reveals phylogeny groups."
weight: "130"
---
6 changes: 6 additions & 0 deletions public/screenshots/orange_can_suggest_which.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "suggestion.png"
thumbnailImage: "suggestion.thumb.png"
title: "Orange can suggest which widget to add to the workflow."
weight: "40"
---
Binary file added public/screenshots/paint-data.png
Binary file added public/screenshots/paint-data.thumb.png
6 changes: 6 additions & 0 deletions public/screenshots/paint_a_two_dimensional.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "paint-data.png"
thumbnailImage: "paint-data.thumb.png"
title: "Paint a two-dimensional data set."
weight: "20"
---
Binary file added public/screenshots/pca-evaluation.png
Binary file added public/screenshots/pca-evaluation.thumb.png
Binary file added public/screenshots/pca.png
Binary file added public/screenshots/pca.thumb.png
6 changes: 6 additions & 0 deletions public/screenshots/playing_with_paint_data_and.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "k-means.png"
thumbnailImage: "k-means.thumb.png"
title: "Playing with Paint Data and an automatic selection of clusters in k-Means."
weight: "120"
---
Binary file added public/screenshots/polynomial-regression.png
6 changes: 6 additions & 0 deletions public/screenshots/predicting_text_categories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "text-predictions.png"
thumbnailImage: "text-predictions.thumb.png"
title: "Predicting text categories."
weight: "280"
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "pca.png"
thumbnailImage: "pca.thumb.png"
title: "Principal component analysis with scree diagram."
weight: "140"
---
Binary file added public/screenshots/rank.png
Binary file added public/screenshots/rank.thumb.png
6 changes: 6 additions & 0 deletions public/screenshots/roc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "roc.png"
thumbnailImage: "roc.thumb.png"
title: "Receiver operating characteristics (ROC) analysis."
weight: "150"
---
Binary file added public/screenshots/roc.png
Binary file added public/screenshots/roc.thumb.png
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "polynomial-regression.png"
thumbnailImage: "polynomial-regression.thumb.png"
title: "Showcase for approximation by regression tree."
weight: "260"
---
Binary file added public/screenshots/sieve-diagram.png
Binary file added public/screenshots/sieve-diagram.thumb.png
6 changes: 6 additions & 0 deletions public/screenshots/sieve_diagram_on_titanic_data_set.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "sieve-diagram.png"
thumbnailImage: "sieve-diagram.thumb.png"
title: "Sieve diagram on Titanic data set."
weight: "70"
---
Binary file added public/screenshots/silhouette.png
Binary file added public/screenshots/silhouette.thumb.png
Binary file added public/screenshots/suggestion.png
Binary file added public/screenshots/suggestion.thumb.png
Binary file added public/screenshots/test-train.png
Binary file added public/screenshots/test-train.thumb.png
Binary file added public/screenshots/text-predictions.png
Binary file added public/screenshots/text-predictions.thumb.png
Binary file added public/screenshots/text-topics.png
Binary file added public/screenshots/text-topics.thumb.png
6 changes: 6 additions & 0 deletions public/screenshots/topic_modelling_of_recent_tweets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "text-topics.png"
thumbnailImage: "text-topics.thumb.png"
title: "Topic modelling of recent tweets."
weight: "290"
---
Binary file added public/screenshots/tree-explorative.png
Binary file added public/screenshots/tree-explorative.thumb.png
Binary file added public/screenshots/venn-misclassified.png
Binary file added public/screenshots/venn-misclassified.thumb.png
6 changes: 6 additions & 0 deletions public/screenshots/visualizing_misclassifications.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
image: "misclassifications.png"
thumbnailImage: "misclassifications.thumb.png"
title: "Visualizing misclassifications."
weight: "210"
---
7 changes: 7 additions & 0 deletions utils/sortByWeight.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function sortByWeight(items: any[]) {
if (!Array.isArray(items)) {
throw new Error("Item is not an array");
}

return items.sort((a, b) => (a.weight || 99999) - (b.weight || 99999));
}
Loading