Drawing a planar embedding

As pictured below, my code doesn’t seem to draw planar embedding, as supposed to. What might be wrong here?

code:

gra1 = IGShorthand["1-2-3-4-5-6-1-7-8-1-9-10-11-12-13-11-14-15-4-16-17-4-18-19-11-20-21-1"]

emb1 = <|1 -> {7,8,2,6,9,21}, 4->{17,16,3,18,15,5}, 11->{14,19,12,13,20,10},2->{1,3}, 3->{2,4}, 5->{4,6},
    6->{5,1},7->{8,1},8->{7,1}, 9->{1,10},10->{9,11},12->{11,13},13->{11,12},14->{11,15},15->{14,4},16->{4,17}, 17->{16,4},18->{4,19},19->{18,11},20->{11,21},21->{20,1}|>

gra11=Graph[gra1, VertexCoordinates -> IGEmbeddingToCoordinates[emb1], ImageSize->800]

Please post the copyable code, not just a screenshot, so I can try it on my computer.

I posted the copyable code.

OK, i figured it out, that in embedding definition the numbers should be consecutive, now it works with:

emb1 = <|1 -> {7,8,2,6,9,21}, 2->{1,3}, 3->{2,4}, 4->{17,16,3,18,15,5}, 5->{4,6},  
6->{5,1},7->{8,1},8->{7,1}, 9->{1,10},10->{9,11}, 11->{14,19,12,13,20,10}, 12->{11,13},13->{11,12},14->{11,15},15->{14,4},16->{4,17}, 17->{16,4},18->{4,19},19->{18,11},20->{11,21},21->{20,1}|>;

More accurately, the ordering of keys in the embedding must match the vertex ordering of the graph.

You could use:

Graph[gra1, 
 VertexCoordinates -> 
  IGEmbeddingToCoordinates[KeyTake[emb1, VertexList[gra1]]], 
 ImageSize -> 800]

Alternatively, you can specify the vertex names in VertexCoordinates. Then the ordering does not matter:

Graph[gra1, 
 VertexCoordinates -> 
  Thread[Keys[emb1] -> IGEmbeddingToCoordinates[emb1]], 
 ImageSize -> 800]

Now I think that

IGFaces[gra11]

{{1, 2, 3, 4, 16, 17, 4, 15, 14, 11, 20, 21}, {1, 21, 20, 11, 12, 13, 11, 10, 9, 1, 7, 8}, {1, 8, 7}, {1, 9, 10, 11, 19, 18, 4, 5, 6}, {1, 6, 5, 4, 3, 2}, {4, 18, 19, 11, 14, 15}, {4, 17, 16}, {11, 13, 12}}

is wrong because the first face should be : {1, 2, 3, 4, 16, 17, 4, 5, 6}

Sorry, I only saw this now.

This graph has more than one planar embedding. Each of those embeddings have different faces. The embedding is unique only if VertexConnectivity[gra1] >= 3.

If you are looking for the faces associated with emb1, you can use IGFaces[emb1].

IGFaces[gra1] returns the faces associated with IGPlanarEmbedding[gra1], which you can draw with IGLayoutPlanar[gra1].