here is my svg animation...its working everywhere but ios (safari or chrome)
<svg width="44" height="44" viewBox="0 0 44 44" xmlns="http://www.w3.org/2000/svg" stroke="#519ecb">
<g fill="none" fill-rule="evenodd" stroke-width="2">
<circle cx="22" cy="22" r="1">
<animate attributeName="r" begin="0s" dur="2.5s" values="1; 20" calcMode="spline" keyTimes="0; 1" keySplines="0.165, 0.84, 0.44, 1"/>
<animate attributeName="stroke-opacity" begin="0s" dur="2.5s" values="1; 0" calcMode="spline" keyTimes="0; 1" keySplines="0.3, 0.61, 0.355, 1" />
</circle>
<circle cx="22" cy="22" r="1">
<animate attributeName="r" begin="-0.9s" dur="2.5s" values="1; 20" calcMode="spline" keyTimes="0; 1" keySplines="0.165, 0.84, 0.44, 1" />
<animate attributeName="stroke-opacity" begin="-0.9s" dur="2.5s" values="1; 0" calcMode="spline" keyTimes="0; 1" keySplines="0.3, 0.61, 0.355, 1" />
</circle>
</g>
</svg>
each animate tag has repeatCount="indefinite" attr but I couldnt write here on code view because of stackoverflow post rules...Its very hard to ask something here...
Related
The textPath is damaged when I fill linear gradient.
How to fix it?
Thanks.
[[the broken image]]: https://i.stack.imgur.com/200t3.png
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.dev/svgjs" width="1000" height="1000">
<g font-size="42.5" font-weight="800">
<path d="M 400, 400
m -100, 0
a 100, 100 0 1,0 200, 0
a 100, 100 0 1,0 -200, 0" fill="transparent" stroke="black" id="SvgjsPath1000"></path>
<circle r="4" cx="400" cy="400" fill="#000000"></circle>
<text stroke-width="10" svgjs:data="{"leading":"1.3"}">
<textPath xlink:href="#SvgjsPath1000" fill="transparent" stroke="#ffffff" svgjs:data="{"leading":"1.3"}">
<tspan alignment-baseline="middle">RRRRRRRRRRRRRRRRRRRRR</tspan>
</textPath>
</text>
<text svgjs:data="{"leading":"1.3"}">
<textPath xlink:href="#SvgjsPath1000" fill="url("#SvgjsLinearGradient1001")" svgjs:data="{"leading":"1.3"}">
<tspan alignment-baseline="middle">RRRRRRRRRRRRRRRRRRRRR</tspan>
</textPath>
</text>
</g>
<defs>
<linearGradient x1="0%" y1="0%" x2="100%" y2="0%" id="SvgjsLinearGradient1001">
<stop offset="0" style="stop-color:#007cf0"></stop>
<stop offset="1" style="stop-color:#ff0080"></stop>
</linearGradient>
</defs>
</svg>
Apparently, a safari specific rendering bug when applying gradients to <textPath> elements.
I could also reproduce this issue with a simplified example (testing in iOS safari):
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="myGradient" gradientTransform="rotate(90)">
<stop offset="5%" stop-color="gold" />
<stop offset="95%" stop-color="red" />
</linearGradient>
</defs>
<path
id="MyPath"
fill="none"
stroke="red"
d="M10,90 Q90,90 90,45 Q90,10 50,10 Q10,10 10,40 Q10,70 45,70 Q70,70 75,50" />
<text>
<textPath fill="url('#myGradient')" href="#MyPath">Quick brown fox jumps over the lazy dog.</textPath>
</text>
</svg>
Workaround: create a <mask> containing the text path:
body {
background: #ccc
}
svg {
width: 50%;
border: 1px solid #000
}
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.dev/svgjs" viewBox="250 250 300 300">
<defs>
<linearGradient x1="0%" y1="0%" x2="100%" y2="0%" id="SvgjsLinearGradient1001">
<stop offset="0" style="stop-color:#007cf0"></stop>
<stop offset="1" style="stop-color:#ff0080"></stop>
</linearGradient>
<mask id="mask" x="0" y="0" width="200%" height="200%">
<rect fill="#000" x="0" y="0" width="200%" height="200%" />
<text>
<textPath class="textPath" font-size="42.5" font-weight="800" href="#SvgjsPath1000" dominant-baseline="middle" fill="#fff">
RRRRRRRRRRRRRRRRRRRRR
</textPath>
</text>
</mask>
</defs>
<g>
<path d="M 300 400 a 100 100 0 1 0 200 0 a 100 100 0 1 0 -200 0 z" fill="transparent" stroke="black" id="SvgjsPath1000" />
<circle r="4" cx="400" cy="400" fill="#000000" />
<text>
<textPath class="textPath" font-size="42.5" font-weight="800" href="#SvgjsPath1000" dominant-baseline="middle" fill="transparent" stroke="#fff" stroke-width="10">
RRRRRRRRRRRRRRRRRRRRR
</textPath>
</text>
<rect mask="url(#mask)" fill="url(#SvgjsLinearGradient1001)" x="0" y="0" width="200%" height="200%" />
</g>
</svg>
I have imported a urdf model from Solidworks using SW2URDF plugin. The model loads correctly on Gazebo but looks weird on RVIZ, even while trying to teleoperate the robot, the revolute joint of the manipulator moves instead of the wheels. Is there anyone who has faced this issue before or has a solution to it?
Here is how it looks on Gazebo
Here is how it looks on RVIZ
Here is the URDF file of the Model:
<?xml version="1.0" encoding="utf-8"?>
<!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner#gmail.com)
Commit Version: 1.6.0-1-g15f4949 Build Version: 1.6.7594.29634
For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
<robot
name="final_assembly3">
<link name="world" />
<joint name="fixed" type="fixed">
<parent link="world" />
<child link="base_link" />
</joint>
<link
name="base_link">
<inertial>
<origin
xyz="0.14768 0.23303 0.22798"
rpy="0 0 0" />
<mass
value="7.6442" />
<inertia
ixx="0.075629"
ixy="3.85E-09"
ixz="-9.5343E-08"
iyy="0.14294"
iyz="1.6837E-11"
izz="0.081345" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/base_link.STL" />
</geometry>
<material
name="">
<color
rgba="1 1 1 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/base_link.STL" />
</geometry>
</collision>
</link>
<link
name="Wheel 1">
<inertial>
<origin
xyz="-3.2558E-07 1.0722E-07 0.030838"
rpy="0 0 0" />
<mass
value="0.5000" />
<inertia
ixx="0.00072916667"
ixy="0.0000000"
ixz="0.0000000"
iyy="0.000625"
iyz="0.0000000"
izz="0.00072916667" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/Wheel 1.STL" />
</geometry>
<material
name="">
<color
rgba="0.89804 0.91765 0.92941 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/Wheel 1.STL" />
</geometry>
</collision>
<gravity>0</gravity>
</link>
<joint
name="Cont 1"
type="continuous">
<origin
xyz="-0.0034084 -0.12798 0.10053"
rpy="-1.5708 0 1.5708" />
<parent
link="base_link" />
<child
link="Wheel 1" />
<axis
xyz="0 0 1" />
</joint>
<link
name="Wheel 2">
<inertial>
<origin
xyz="-3.2557837015279E-07 1.07217308559227E-07 0.0308380289896838"
rpy="0 0 0" />
<mass
value="0.5000" />
<inertia
ixx="0.00072916667"
ixy="0.0000000"
ixz="0.0000000"
iyy="0.000625"
iyz="0.0000000"
izz="0.00072916667" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/Wheel 2.STL" />
</geometry>
<material
name="">
<color
rgba="0.898039215686275 0.917647058823529 0.929411764705882 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/Wheel 2.STL" />
</geometry>
</collision>
<gravity>0</gravity>
</link>
<joint
name="Cont 2"
type="continuous">
<origin
xyz="0.29877 -0.32798 0.10053"
rpy="1.5708 0 1.5708" />
<parent
link="base_link" />
<child
link="Wheel 2" />
<axis
xyz="0 0 1" />
</joint>
<link
name="Wheel 3">
<inertial>
<origin
xyz="-3.26336083100731E-07 1.07668861937249E-07 -0.0308380347831287"
rpy="0 0 0" />
<mass
value="0.5000" />
<inertia
ixx="0.00072916667"
ixy="0.0000000"
ixz="0.0000000"
iyy="0.000625"
iyz="0.0000000"
izz="0.00072916667" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/Wheel 3.STL" />
</geometry>
<material
name="">
<color
rgba="0.898039215686275 0.917647058823529 0.929411764705882 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/Wheel 3.STL" />
</geometry>
</collision>
<gravity>0</gravity>
</link>
<joint
name="Cont 3"
type="continuous">
<origin
xyz="-0.0034084 -0.32798 0.10053"
rpy="1.5708 0 1.5708" />
<parent
link="base_link" />
<child
link="Wheel 3" />
<axis
xyz="0 0 1" />
</joint>
<link
name="Wheel 4">
<inertial>
<origin
xyz="-3.26299866348911E-07 1.07652009542769E-07 0.0291707139063403"
rpy="0 0 0" />
<mass
value="0.5000" />
<inertia
ixx="0.00072916667"
ixy="0.0000000"
ixz="0.0000000"
iyy="0.000625"
iyz="0.0000000"
izz="0.00072916667" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/Wheel 4.STL" />
</geometry>
<material
name="">
<color
rgba="0.898039215686275 0.917647058823529 0.929411764705882 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/Wheel 4.STL" />
</geometry>
</collision>
<gravity>0</gravity>
</link>
<joint
name="Cont 4"
type="continuous">
<origin
xyz="0.30046 -0.12798 0.10053"
rpy="1.5708 0.62487 1.5708" />
<parent
link="base_link" />
<child
link="Wheel 4" />
<axis
xyz="0 0 1" />
</joint>
<gazebo>
<plugin name="object_controller" filename="libgazebo_ros_planar_move.so">
<commandTopic>cmd_vel</commandTopic>
<odometryTopic>odom</odometryTopic>
<odometryFrame>odom</odometryFrame>
<odometryRate>50.0</odometryRate>
<robotBaseFrame>base_footprint</robotBaseFrame>
</plugin>
</gazebo>
<link
name="New Static Link">
<inertial>
<origin
xyz="0.0172790917411035 0.102994908792773 -0.000286417787769305"
rpy="0 0 0" />
<mass
value="1.94401355435528" />
<inertia
ixx="0.00768941377852196"
ixy="-0.0023016367314421"
ixz="2.28881904576314E-05"
iyy="0.00450259485431559"
iyz="3.78227208152756E-05"
izz="0.0103483641272583" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/New Static Link.STL" />
</geometry>
<material
name="">
<color
rgba="1 1 1 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/New Static Link.STL" />
</geometry>
</collision>
<gravity>0</gravity>
</link>
<joint
name="Fixed"
type="fixed">
<origin
xyz="0.14768 -0.22798 0.33053"
rpy="1.5708 0 -1.581" />
<parent
link="base_link" />
<child
link="New Static Link" />
<axis
xyz="0 1 0" />
</joint>
<link
name="Arm">
<inertial>
<origin
xyz="0.13229755761114 -0.000278839398755615 -0.0323012411261709"
rpy="0 0 0" />
<mass
value="1.80462691606488" />
<inertia
ixx="0.00337104522287667"
ixy="2.3173417802539E-05"
ixz="-0.000161183912931026"
iyy="0.0199987994056373"
iyz="-1.64319461670501E-06"
izz="0.0222082055539029" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/Arm.STL" />
</geometry>
<material
name="">
<color
rgba="1 1 1 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/Arm.STL" />
</geometry>
</collision>
<gravity>0</gravity>
</link>
<joint
name="Rev1"
type="revolute">
<origin
xyz="0.06 0.18 -0.030782"
rpy="0 0 0.18829" />
<parent
link="New Static Link" />
<child
link="Arm" />
<axis
xyz="0 0 1" />
<limit
lower="0"
upper="0"
effort="0"
velocity="0" />
</joint>
<link
name="Pris 1">
<inertial>
<origin
xyz="0.0335816493728636 1.71749397870347E-07 0.0119354658625156"
rpy="0 0 0" />
<mass
value="0.123182781546625" />
<inertia
ixx="3.77360992389157E-05"
ixy="1.28183032967861E-11"
ixz="-5.81374538385023E-06"
iyy="0.000122947375330809"
iyz="2.65123689114698E-10"
izz="0.000144337931781889" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/Pris 1.STL" />
</geometry>
<material
name="">
<color
rgba="1 1 1 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/Pris 1.STL" />
</geometry>
</collision>
<gravity>0</gravity>
</link>
<joint
name="Pris 1"
type="revolute">
<origin
xyz="0.1 0 -0.063391"
rpy="3.1416 0 -1.9477" />
<parent
link="Arm" />
<child
link="Pris 1" />
<axis
xyz="0 0 1" />
<limit
lower="0"
upper="0"
effort="0"
velocity="0" />
</joint>
<link
name="Pris 2">
<inertial>
<origin
xyz="1.8466057571942E-09 -5.55111512312578E-17 0.01"
rpy="0 0 0" />
<mass
value="0.260668670250234" />
<inertia
ixx="7.94869252643328E-05"
ixy="-2.07014852308951E-18"
ixz="2.73993982613085E-18"
iyy="0.00115947637560852"
iyz="1.99348984198689E-09"
izz="0.00122317832768109" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/Pris 2.STL" />
</geometry>
<material
name="">
<color
rgba="1 1 1 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/Pris 2.STL" />
</geometry>
</collision>
<gravity>0</gravity>
</link>
<joint
name="Pris 2"
type="revolute">
<origin
xyz="-0.0014893 -0.078861 0.020827"
rpy="0 0 0.90855" />
<parent
link="Pris 1" />
<child
link="Pris 2" />
<axis
xyz="0 0 0" />
<limit
lower="0"
upper="0"
effort="0"
velocity="0" />
</joint>
<link
name="Pris 3">
<inertial>
<origin
xyz="-0.166565243027124 0.000967072198009372 0.0300000329001753"
rpy="0 0 0" />
<mass
value="0.449710314809642" />
<inertia
ixx="0.00137456804218307"
ixy="-4.43060167581936E-05"
ixz="9.82391747567394E-10"
iyy="0.002208699287522"
iyz="-1.54947639651244E-09"
izz="0.00315643719811711" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/Pris 3.STL" />
</geometry>
<material
name="">
<color
rgba="1 1 1 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://final_assembly3/meshes/Pris 3.STL" />
</geometry>
</collision>
<gravity>0</gravity>
</link>
<joint
name="Pris 3"
type="prismatic">
<origin
xyz="0.20514 0.030503 -0.039218"
rpy="-1.5708 0 3.1416" />
<parent
link="Arm" />
<child
link="Pris 3" />
<axis
xyz="1 0 0" />
<limit
lower="0"
upper="0"
effort="0"
velocity="0" />
</joint>
</robot>
ROS version:ROS Melodic
Ubuntu 18.04
So, I realized two problems:
First, you have to change the fixed frame in the global options of RViz to world or provide a transformation between map and world.
Second, your URDF seems broken. There is something wrong with your revolute-typed joints. Changing their type to fixed fixed the problem. I think, it's best if you ask a separate question with a minimal example regarding this second problem.
To be able to perform a correct visualization under rviz, you must change fixed frame from "map" to "world" or "base_link" depending on the reference you want to choose.
I had a similar issue. In my case I had nothing publishing on the topic /state which rviz expect to put together the part of your robot described in /robot_description. You should try looking if a joint_state_broadcaster is launched (it is what forward the joint state from gazebo to ROS)
I am trying to customize the favicon for our .net core api and set it to an image within our project structure. I am not able to get it to load though and have tried a few things that have not worked. This is how I am using my custom html for Swashbuckle in Startup.cs (Located in a folder called Swagger):
app.UseSwaggerUI(c =>
{
c.IndexStream = () => GetType().GetTypeInfo().Assembly
.GetManifestResourceStream("MyProject.Swagger.index.html");
});
Attempt #1:
Add the use of StaticFiles to my Startup.cs Configure method like so:
app.UseStaticFiles();
Then I placed the the logo.png (Set as Copy Always) inside the wwwroot folder under an Images folder and tried to reference it in the html like this. (I have also tried to reference it from an Images folder in the same directory as the html).
<link rel="icon" type="image/png" href="~/Images/logo.png" />
No dice and there is now no favicon in the tab.
Attempt #2.
Overwrite the favicon via Javascript inside the html file.
var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/png';
link.rel = 'icon';
link.href = '~/Images/logo.png';
document.getElementsByTagName('head')[0].appendChild(link);
No dice, the swagger favicon still exists.
Has anybody successfully been able to replace the favicon using Swashbuckle?
The version of Swashbuckle I am using is Swashbuckle.AspNetCore 2.4.0
This is the html file I am using based on the default file from here https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/master/src/Swashbuckle.AspNetCore.SwaggerUI/index.html
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>%(DocumentTitle)</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Source+Code+Pro:300,600|Titillium+Web:400,600,700" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="./swagger-ui.css">
<link rel="icon" type="image/png" href="~/Images/logo.png" />
<style>
html {
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
body {
margin: 0;
background: #fafafa;
}
hgroup.main {
display: none;
}
.swagger-ui .topbar {
background-color: #00CCCC;
}
</style>
%(HeadContent)
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="position:absolute;width:0;height:0">
<defs>
<symbol viewBox="0 0 20 20" id="unlocked">
<path d="M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z"></path>
</symbol>
<symbol viewBox="0 0 20 20" id="locked">
<path d="M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z" />
</symbol>
<symbol viewBox="0 0 20 20" id="close">
<path d="M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z" />
</symbol>
<symbol viewBox="0 0 20 20" id="large-arrow">
<path d="M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z" />
</symbol>
<symbol viewBox="0 0 20 20" id="large-arrow-down">
<path d="M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z" />
</symbol>
<symbol viewBox="0 0 24 24" id="jump-to">
<path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z" />
</symbol>
<symbol viewBox="0 0 24 24" id="expand">
<path d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z" />
</symbol>
</defs>
</svg>
<div id="swagger-ui"></div>
<!-- Workaround for https://github.com/swagger-api/swagger-editor/issues/1371 -->
<script>
if (window.navigator.userAgent.indexOf("Edge") > -1) {
console.log("Removing native Edge fetch in favor of swagger-ui's polyfill")
window.fetch = undefined;
}
</script>
<script src="./swagger-ui-bundle.js"></script>
<script src="./swagger-ui-standalone-preset.js"></script>
<script>
window.onload = function () {
var configObject = JSON.parse('%(ConfigObject)');
var oauthConfigObject = JSON.parse('%(OAuthConfigObject)');
// Apply mandatory parameters
configObject.dom_id = "#swagger-ui";
configObject.presets = [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset];
configObject.layout = "StandaloneLayout";
// If oauth2RedirectUrl isn't specified, use the built-in default
if (!configObject.hasOwnProperty("oauth2RedirectUrl"))
configObject.oauth2RedirectUrl = window.location.href.replace("index.html", "oauth2-redirect.html");
// Build a system
const ui = SwaggerUIBundle(configObject);
// Apply OAuth config
ui.initOAuth(oauthConfigObject);
//Custom scripting
document.getElementsByClassName("link")[0].innerHTML = "Application Name";
document.getElementsByClassName("link")[0].removeAttribute("href");
}
</script>
</body>
I ran into a similar problem. However, I utilized the Index located here:
https://github.com/domaindrivendev/Swashbuckle.AspNetCore/tree/master/test/WebSites/CustomUIIndex/Swagger
From here, I was able to change the logo with the following:
<div id="header">
<section class="swagger-ui swagger-container" data-reactroot="">
<div class="topbar">
<div class="wrapper">
<div class="topbar-wrapper">
<a class="link">
<img alt="Swagger UI" src="/Swagger/UI/Logo.jpg" />
<span style="font-size:medium; color:black;text-wrap:none;text-align:right" >YourTitle</span>
</a>
</div>
</div>
</div>
</section>
</div>
I have an SVG that doesn't seem to work with iOS devices.
I've tried in both chrome and safari only the SVG appears as a solid blue block colour and doesn't preserve the different layers and their opacity levels...
https://jsfiddle.net/2fLuspdm/
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1920 3840" style="enable-background:new 0 0 1920 3840;" xml:space="preserve">
<style type="text/css">
.st0{opacity:6.000000e-02;fill:#609FD0;enable-background:new ;}
</style>
<polygon class="st0" points="1920,2614 1920,3641 1470,3005.1 "/>
<polygon class="st0" points="1920,1612.4 1210,780 1920,0.4 "/>
<polyline class="st0" points="0,0 650,0 0,1184.3 1,0 "/>
<polygon class="st0" points="0,898.4 960,1457 0,2778.4 "/>
<polygon class="st0" points="0,3837.4 0,2654 1040,3840 "/>
<polygon class="st0" points="1920,2926 1424,2239 1920,1046 "/>
<polygon class="st0" points="829,3840 1920,2926 1936,3840 "/>
<polygon class="st0" points="0,2530 0,1760 960,2909 "/>
<polygon class="st0" points="1920,0.4 1920,622 40,0.4 "/>
<polygon class="st0" points="1920,1634.5 1920,2404.5 1150,1435.5 "/>
</svg>
Simply compute the exponential (not sure if it's valid SVG syntax, but Safari doesn't like it).
<style type="text/css">
.st0{opacity:.06; fill:#609FD0; enable-background:new ;}
</style>
I want to use a custom cursor in my SVG file.
The cursor is defined in the same SVG file as the rest of my document:
<defs>
<g id="cursor-symbol">
<circle fill-opacity="0.8" fill="white" r="10.0" cx="10.0" cy="10.0" stroke="black" stroke-width="2.0" stroke-opacity="1"/>
<line y2="20.0" x1="10.0" x2="0.0" transform="rotate(45.0, 10.0, 10.0)" y1="10.0"/>
</g>
</defs>
Then I tried to use that cursor, but can't find out how to reference it:
<rect cursor="url(#cursor-symbol)" x="0" y="0" width="100" height="100" />
The attribute value seems to be invalid.
I also created a cursor element and tried with that:
<defs>
<g id="cursor-symbol">
<circle fill-opacity="0.8" fill="white" r="10.0" cx="10.0" cy="10.0" stroke="black" stroke-width="2.0" stroke-opacity="1"/>
<line y2="20.0" x1="10.0" x2="0.0" transform="rotate(45.0, 10.0, 10.0)" y1="10.0"/>
</g>
<cursor id="cursor" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#cursor-symbol"/>
</defs>
...
<rect cursor="url(#cursor)" x="0" y="0" width="100" height="100" />
but to no avail.
How to I reference such a cursor that is defined in the same document?