Skip to content

Commit

Permalink
Allow fixed fallback logo
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Oct 15, 2024
1 parent b5b6e44 commit c9c2f16
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 29 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"charts"
],
"license": "MIT",
"version": "0.0.7",
"version": "0.0.8",
"type": "module",
"main": "./dist/galaxy-charts.umd.cjs",
"module": "./dist/galaxy-charts.js",
Expand Down
21 changes: 0 additions & 21 deletions public/galaxy-charts.txt

This file was deleted.

2 changes: 1 addition & 1 deletion public/galaxy-charts.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE visualization SYSTEM "../../visualization.dtd">
<visualization name="Test Environment" logo="galaxy-charts.svg">
<visualization name="Test Environment">
<description>Welcome to Galaxy Charts.</description>
<specs>
<type>spec_type</type>
Expand Down
2 changes: 1 addition & 1 deletion src/components/GalaxyCharts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if (visualizationConfig.dataset_url) {
}
// determine logo url
const logoUrl = computed(() => `${root}${logo.value}`);
const logoUrl = computed(() => logo.value && `${root}${logo.value}`);
// toggle side panel
async function onToggle() {
Expand Down
11 changes: 9 additions & 2 deletions src/components/SidePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
AdjustmentsHorizontalIcon,
ChevronDoubleRightIcon,
CloudArrowUpIcon,
PresentationChartLineIcon,
Square3Stack3DIcon,
} from "@heroicons/vue/24/outline";
import { NButton, NIcon, NInput, NTabs, NTabPane } from "naive-ui";
Expand Down Expand Up @@ -138,7 +137,15 @@ function onUpdateTracks(newValues) {
<div class="flex justify-center center-items">
<div class="m-2">
<img v-if="props.logoUrl" :src="props.logoUrl" class="min-w-14 max-w-14 object-contain" />
<PresentationChartLineIcon v-else class="size-10" />
<svg
v-else
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 100 100"
class="size-14">
<circle cx="50" cy="50" r="45" stroke="#E30A17" stroke-width="5" fill="#FFFFFF" />
<path d="M 50,5 A 45,45 0 0,1 95,50 L 50,50 Z" fill="#E30A17" />
</svg>
</div>
</div>
<div class="overflow-hidden break-words p-1">
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/parseDefaults.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ test("parse defaults", () => {
{ name: "f" },
{ value: "g" },
]),
).toEqual({ a: "b", c: "d", "e": null, "f": null });
).toEqual({ a: "b", c: "d", e: null, f: null });
});
3 changes: 1 addition & 2 deletions src/utilities/parseXML.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import axios from "axios";
import { getFileName } from "@/utilities/getFileName";

const DEFAULT_LOGO = "charts.svg";
const parser = new DOMParser();

// populates base xml with nodes from linked macro files
Expand Down Expand Up @@ -74,7 +73,7 @@ export async function parseXML(xmlFileName) {
result.html = xmlDoc.documentElement.getAttribute("name");

// parse logo
result.logo = xmlDoc.documentElement.getAttribute("logo") || DEFAULT_LOGO;
result.logo = xmlDoc.documentElement.getAttribute("logo");

// parse description
const descriptionNode = xmlDoc.documentElement.getElementsByTagName("description");
Expand Down

0 comments on commit c9c2f16

Please sign in to comment.