Skip to content

Commit

Permalink
Merge pull request #20 from geospiza-fortis/even-more-fixes
Browse files Browse the repository at this point in the history
Add minor fixes
  • Loading branch information
geospiza-fortis committed Mar 2, 2021
2 parents 934d0db + 0efe726 commit 4fc0d39
Show file tree
Hide file tree
Showing 34 changed files with 1,239 additions and 1,916 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# owlrepo-client

This is the source for [OwlRepo](https://owlrepo.com).
This is the client source for [OwlRepo](https://owlrepo.com).

## Get started

Expand All @@ -18,7 +18,7 @@ Copy over the `.env.template` to `.env` to define the testing server. Then start
npm run dev
```

Navigate to [localhost:5000](http://localhost:5000). You should see your app
Navigate to [localhost:3000](http://localhost:3000). You should see your app
running. Edit a component file in `src`, save it, and reload the page to see
your changes.

Expand Down
2,257 changes: 764 additions & 1,493 deletions package-lock.json

Large diffs are not rendered by default.

28 changes: 15 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "owlrepo-client",
"version": "2.1.0",
"repository": "https://bitbucket.org/geospiza/owlrepo",
"version": "2.2.0",
"repository": "https://github.com/geospiza-fortis/owlrepo-client",
"license": "MIT",
"scripts": {
"dev": "sapper dev",
Expand All @@ -10,25 +10,27 @@
"start": "node __sapper__/build"
},
"devDependencies": {
"sapper": "^0.29.1",
"@babel/core": "^7.12.17",
"@babel/core": "^7.13.8",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.12.17",
"@babel/preset-env": "^7.12.17",
"@babel/runtime": "^7.12.18",
"@babel/plugin-transform-runtime": "^7.13.9",
"@babel/preset-env": "^7.13.9",
"@babel/runtime": "^7.13.9",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-inject": "^4.0.2",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.2.0",
"@rollup/plugin-replace": "^2.3.4",
"rollup-plugin-node-globals": "^1.4.0",
"@rollup/plugin-replace": "^2.4.1",
"dotenv": "^8.2.0",
"mdsvex": "^0.8.9",
"rollup": "^2.39.0",
"prettier": "^2.2.1",
"prettier-plugin-svelte": "^2.1.6",
"rollup": "^2.40.0",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-svelte": "^7.1.0",
"rollup-plugin-terser": "^7.0.2",
"svelte": "^3.32.3"
"sapper": "^0.29.1",
"svelte": "^3.35.0"
},
"dependencies": {
"bootstrap": "^4.6.0",
Expand All @@ -42,15 +44,15 @@
"json-stable-stringify": "^1.0.1",
"jsonschema": "^1.4.0",
"localforage": "^1.9.0",
"lodash": "^4.7.0",
"lodash": "^4.17.21",
"moment": "^2.29.1",
"node-jose": "^2.0.0",
"numeral": "^2.0.6",
"p-retry": "^4.4.0",
"p-timeout": "^4.1.0",
"polka": "next",
"popper.js": "^1.16.1",
"simple-statistics": "^7.4.1",
"simple-statistics": "^7.6.0",
"sirv": "^1.0.11",
"svelte-loading-spinners": "^0.1.4",
"sveltestrap": "^3.13.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/ActivityHeatmap.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
.subtract(range - 1, "months")
.toDate(),
data: transformData(data),
tooltip: true
tooltip: true,
});
}
Expand Down
12 changes: 6 additions & 6 deletions src/components/CollapseInfo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
let open = false;
</script>

<style>
div {
padding-bottom: 1em;
}
</style>

<div>
<button class="btn btn-info" type="button" on:click={() => (open = !open)}>
{text}
Expand All @@ -23,3 +17,9 @@
<svelte:component this={component} bind:params />
</Collapse>
</div>

<style>
div {
padding-bottom: 1em;
}
</style>
34 changes: 17 additions & 17 deletions src/components/IndexView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
listings[i].metadata = {
mode: "unknown",
pages: -1,
items: -1
items: -1,
};
}
}
Expand All @@ -60,13 +60,6 @@
});
</script>

<style>
#spinner {
width: 100px;
margin: 0 auto;
}
</style>

{#if listings.length > 0}
<table class="table table-sm table-bordered">
<tr>
Expand All @@ -77,7 +70,7 @@
</tr>
{#each listings as entry}
<tr>
<td>{entry.completion_timestamp.split('.')[0]}</td>
<td>{entry.completion_timestamp.split(".")[0]}</td>
<td>
<a href="/listing/{entry.id}">{entry.metadata.mode}</a>
</td>
Expand All @@ -96,7 +89,8 @@
offset = 0;
}
await update();
}}>
}}
>
Previous
</button>
{:else}
Expand All @@ -110,15 +104,21 @@
on:click={async () => {
offset += limit;
await update();
}}>
}}
>
Next
</button>
{/if}
Page {Math.ceil(offset / limit) + 1}
{:else}
{#if !is_cached}
<div id="spinner">
<Stretch size="60" color="#FF3E00" unit="px" />
</div>
{/if}
{:else if !is_cached}
<div id="spinner">
<Stretch size="60" color="#FF3E00" unit="px" />
</div>
{/if}

<style>
#spinner {
width: 100px;
margin: 0 auto;
}
</style>
3 changes: 1 addition & 2 deletions src/components/LastUpload.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
export function refreshLastUpload(data_url = null, task_id = null) {
lastUpload.set({
img: refreshStorage("last-upload-data-url", data_url),
task_id: refreshStorage("last-upload-task-id", task_id)
task_id: refreshStorage("last-upload-task-id", task_id),
});
}
</script>

<script>
import { onMount } from "svelte";
import { writable } from "svelte/store";
function refreshStorage(key, value = null) {
if (value) {
Expand Down
21 changes: 11 additions & 10 deletions src/components/Navbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{
text: "Forum",
href:
"https://forum.maplelegends.com/index.php?threads/owlrepo-a-repository-of-transcribed-owl-searches.32316/"
}
"https://forum.maplelegends.com/index.php?threads/owlrepo-a-repository-of-transcribed-owl-searches.32316/",
},
];
</script>

Expand All @@ -27,7 +27,7 @@
UncontrolledDropdown,
DropdownToggle,
DropdownMenu,
DropdownItem
DropdownItem,
} from "sveltestrap/src";
const breakpoint = 4;
Expand All @@ -40,12 +40,6 @@
}
</script>

<style>
:global(.nav-link) {
color: rgba(255, 255, 255, 0.95);
}
</style>

<Navbar class="navbar-dark bg-primary" expand="md">
{#if !isOpen}
<NavbarBrand href="/">
Expand All @@ -65,7 +59,8 @@
<NavItem>
<NavLink
href={item.href}
active={!segment ? '' == item.href : segment == item.href}>
active={!segment ? "" == item.href : segment == item.href}
>
{item.text}
</NavLink>
</NavItem>
Expand All @@ -89,3 +84,9 @@
</Nav>
</Collapse>
</Navbar>

<style>
:global(.nav-link) {
color: rgba(255, 255, 255, 0.95);
}
</style>
10 changes: 5 additions & 5 deletions src/components/Plot.svelte
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<script>
export let data;
export let transform = res => res;
export let transform = (res) => res;
export let layout = {};
let plotElement;
let darkStyle = {
font: {
color: "#fff"
color: "#fff",
},
paper_bgcolor: "#222222",
plot_bgcolor: "#222222"
plot_bgcolor: "#222222",
};
$: plotElement &&
Expand All @@ -22,10 +22,10 @@
margin: {
l: 50,
r: 0,
b: 50
b: 50,
},
...darkStyle,
...layout
...layout,
},
{ responsive: true }
);
Expand Down
36 changes: 18 additions & 18 deletions src/components/PriceQuantityCharts.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,62 @@
function transform(data, search_item) {
let items = data.filter(
item => item.search_item === search_item && item.percent_complete > 0.6
(item) => item.search_item === search_item && item.percent_complete > 0.6
);
let x = items.map(item => new Date(item.search_item_timestamp));
let x = items.map((item) => new Date(item.search_item_timestamp));
return ["p0", "p25", "p50", "p75", "p100"]
.map(label => {
.map((label) => {
return {
x: x,
y: items.map(item => item[label]),
y: items.map((item) => item[label]),
name: label === "p0" ? "min" : label === "p100" ? "max" : label,
mode: "lines+markers",
visible: label == "p50" ? true : "legendonly"
visible: label == "p50" ? true : "legendonly",
};
})
.concat([
{
x: items.map(item => new Date(item.search_item_timestamp)),
y: items.map(item => item.search_results),
x: items.map((item) => new Date(item.search_item_timestamp)),
y: items.map((item) => item.search_results),
name: "search_results",
mode: "lines+markers",
xaxis: "x",
yaxis: "y2"
yaxis: "y2",
},
{
x: items.map(item => new Date(item.search_item_timestamp)),
y: items.map(item => item.sum_bundle),
x: items.map((item) => new Date(item.search_item_timestamp)),
y: items.map((item) => item.sum_bundle),
name: "sum_bundle",
mode: "lines+markers",
xaxis: "x",
yaxis: "y2",
visible: "legendonly"
}
visible: "legendonly",
},
]);
}
const layout = {
title: `${search_item_name} over time`,
legend: { orientation: "h" },
yaxis: {
title: "price"
title: "price",
},
yaxis2: {
title: "count"
title: "count",
},
grid: {
rows: 2,
columns: 1,
subplots: ["xy", "xy2"],
roworder: "top to bottom"
roworder: "top to bottom",
},
margin: {
l: 50,
r: 0,
b: 0,
t: 100
}
t: 100,
},
};
</script>

<Plot {data} transform={data => transform(data, search_item_name)} {layout} />
<Plot {data} transform={(data) => transform(data, search_item_name)} {layout} />

0 comments on commit 4fc0d39

Please sign in to comment.