# Tikz Graph How to drop shadow like in figure

I'm able to generate a tikz node with shadow (lower right) on the node, but this is different than shading not the entire node, but just the circle and edges like in the picture below.

The shadow on each edge is not really the problem, but the shadow in the nodes, that is dropped by the circle not only externally but also inside the node is something that I was not able to do in Tikz.

Minimum working tex:

\documentclass{article}
\usepackage{tikz}
\usepackage{fullpage}

\begin{document}

\begin{tikzpicture}[main/.style = {draw, circle, text=black,
\node[main] (1) {$x_1$};
\end{tikzpicture}

\end{document}


• If you don't want the shadow inside fill the node with bg-color, probably white. – Harald Lichtenstein May 12 at 19:14
• @Harald Lichtenstein: He does want the shadow inside. – hpekristiansen May 12 at 19:50

There are probably better ways to do this, but here I use a fuzzy ring 15 percent fading:

\documentclass[tikz, border=0.1cm]{standalone}
\begin{document}
\begin{tikzpicture}[
main/.style = {draw, circle, text=black,
preaction={draw, ultra thick, transform canvas={yshift=-0.2ex}, path fading=fuzzy ring 15 percent, opacity=0.25}
}]
\node[main] (1) {$x_1$};
\end{tikzpicture}
\end{document}


Edit:

The solution only works for circles and ellipses - not for e.g. polygons as shown here:

\documentclass[tikz, border=0.1cm]{standalone}
\node[main] (1) {$x_1$};